Clickism / ClickVillagers

A simple 1.20 plugin that makes handling villagers a lot easier.
Other
4 stars 2 forks source link

[0.1] Expected Villager not retrieved if Chunk 0,0 in overworld is not loaded (new villager created instead) #3

Closed TigerWalts closed 1 year ago

TigerWalts commented 1 year ago

Picked up villagers are stored at a hard-coded location in the Overworld (1,-70,1). If this location is not currently loaded when a villager head is placed then the stored villager will not be retrieved and a new one is spawned in and placed instead.

This can happen if the server's spawn is far enough away from chunk 0,0.

This means that you lose the villager with the profession and trades you were expecting.

https://github.com/Clickism/ClickVillagers/blob/90afe95e46c9e672e9f586d7af87aefa4bbefea4/src/main/java/me/clickism/clickvillagers/ClickVillagers.java#L148-L160

Bukkit.getEntity(uuid) appears to only get an entity if it is loaded, otherwise it returns null.

Possible ways to fix:


Current workaround is to force load the chunk: /forceload add 0 0