Started by
GushyGwar
on
Topic category: Help with Minecraft modding (Java Edition)
Hello! I'm trying to create a mob that can be picked up with a pot, similar to how fish can be picked up with a water bucket, but I'm having one problem. I can't figure out how to store the NBT data of the entity that despawns and apply it to the one that spawns in later. I need this so the entity can keep it's name, ID, health, potion effects, etc.
How can I modify the procedures I've made to make this happen?
Here I contribute my grain of sand.
I know you can call things using a command, the name can be stored in a player-persistent variable, grabbed using the "get display name" block. The rest of the text NBTs, I don't know how to grab them, I only find blocks to grab custom NBTs.
You will have to add a little to the coordinates to correct the offset.
I think there are blocks to take the NBTs you mentioned, although if by ID you mean the UUID, I don't think it's necessary to keep it. I just tested and vanilla axolotls don't keep it either.
But health and potions can be taken (in the case of potions I only see the option to take one by one, so potion effects from other mods would not be kept, I suppose). I hope someone else responds with a better solution, because I'm sure I'll need it at some point too.