Paper: Proposal: Option to disable villager despawn

Created on 11 Mar 2017  路  11Comments  路  Source: PaperMC/Paper

Suggestion

My server is currently seeing villagers despawning periodically after recently switching to paper. I believe this to be a result of the logic in play here (not the changes specifically, but the overall code). https://github.com/PaperMC/Paper/blob/748d86a5407ca58c16b3cdf53715e73c5c1faa95/Spigot-Server-Patches/0011-Add-configurable-despawn-distances-for-living-entiti.patch

Add instanceof(EntityVillager) and skip the check likewise a log or option to log when they are despawned. Thoughts?

Full disclosure I don't know the minecraft code well, nor Java. It seems that Villagers are included in these checks? EntityVillager -> EntityAgeable -> EntityCreature -> EntityInsentient. I should be able to submit the changes, should this be accepted.

Note: I am using the React plugin, and I have disabled all villager culling/purging. I have also checked the logs to support they are not being culled/purged from that Plugin. In the meantime I am just bumping those values to there vanilla settings will comment here if villagers are still despawning.

My Active Plugins:

  • React
  • dynmap
  • BetterBeds
  • Lockette
  • Plugman
  • Staff+
  • WorldAnchor
  • zPermissions

Most helpful comment

Those despawn ranges are for non persistent entities only. Animals (including villagers) are by default persistent, while monsters, bats and squids are not.

You should use the forums for help configuring your plugins.

All 11 comments

Those despawn ranges are for non persistent entities only. Animals (including villagers) are by default persistent, while monsters, bats and squids are not.

You should use the forums for help configuring your plugins.

@Black-Hole

Ah, vanilla had a double check with this.isTypeNotPersistent() and I didn't notice the outer if _should_ already grab it which is _probably_ why it was removed in craftbukkit.

if (this.persistent) 

I'm fairly certain the plugins are not responsible. I listed them only for informational purposes (react logs when it culls/purges entities). Are you able to point me to where / direction where EntityVillager.persistent is set? Likewise anywhere else in the codebase you can point me?

Are villagers despawning per se or inside of the minecarts?

You should be able to check the persistence with a quick plugin or with "/entitydata @e[r=5] {}".

Anyway, without plugins villagers are spawned persistent and won't despawn.

@polkovnikov-ph nothing to do with minecarts, disappearing from fully lit rooms (well guarded). I added logs for any time EntityVillager.die() is called, hopefully that will suss out the culprit.

I am also having a similar problem with this. Since adding Paper to our project, entities that are marked as persistent and spawned by our unique plugin get removed. There should at least be an option to disable the distance de-spawning code.

To my knowledge, only non-persistent entities should be removed. You can listen for your entities in EntityRemoveFromWorldEvent by checking their unique IDs, from there you can trace where in NMS this is occurring.

If something looks off, feel free to send us the stacktraces you're seeing.

Edit: Keep in mind that event will be called as part of a chunk unload, but your entities will be restored with that chunk. So it's important to verify the cause before being alarmed.

Did you ever discover anything pertinent to this issue?

Does anyone still have this problem and if so did they ever bother looking into the cause?

@zachbr I did some investigation with a custom paper build that logged all the villager despawns and didn't find anything conclusive. Ultimately we haven't been playing enough to really know if this is an issue. Thinking back I'm inclined to blame the React server optimizer plugin, I trust this team more than than project, but I have no evidence. I've disabled the plugin after the next minecraft binge I'll drop a line here with any results.

It might be appropriate to close this issue based on that, I'll leave it to you.

Closing at this time. If it comes up again feel free to let us know.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

molor picture molor  路  3Comments

Decme picture Decme  路  3Comments

ShelLuser picture ShelLuser  路  3Comments

BillyGalbreath picture BillyGalbreath  路  3Comments

successed picture successed  路  3Comments