Pets cannot be loaded from a world file
riking opened this issue ยท 2 comments
When Minecraft attempts to load a pet and it correctly detects the classname, such as com.github.dsh105.echopet.entity.pet.chicken.EntityChickenPet
, it attempts to invoke the standard NBT entity loading codepath, which looks something like this:
- Invoke constructor of (World)
- Call load(NBTTagCompound)
The Pet classes do not implement either of those, and as such they are unable to be loaded from NBT.
This causes problems not only with server restarts (http://pastebin.com/3xLf9KB4) but also for my plugin, TemplateWorlds. It copies all entities from the "backup" to the "live" world via this same codepath - construct the new entity with the World constructor, save the entity in the backup to a NBT Tag and load the new one in the live world using that same tag.
I ask that you consider saving information that will let you retrieve the Pet instance in the NBT that gets saved in the world.
Now that I have learnt more about the plugin, I can see that this is in fact not an issue. Closing ticket.