Started by
Brianitsagoodname
on
Topic category: Help with Minecraft modding (Java Edition)
i wanna make when a syringe hit a mob the mob's id are store inside a nbt tag inside the syringe, there is a way that i can do this with procedure blocks?
Not entirely sure if I completely understand you, but if by "mob's id" you're talking about Minecraft IDs like "minecraft:minecart" then I'm not sure off the top of my head if there is a procedure that can get the Minecraft id of an entity. There are two potential things you could try though.
If you just want to store the name of the entity, and don't need the Minecraft id of the entity, then that would be a lot simpler to do.
Firstly, you could try creating a procedure for the syringe with the trigger "when right clicked on an entity". Next, you would set the text NBT tag of the syringe to "get display name of event/target entity". The issues with this would be it may not work with other modded entities and if you would like it to work with your modded entities, you'd likely have to set up some if statements that check to see if the display name matches one of your modded entities, and if it does, you add in your mods id. It also wouldn't work properly if the entity's display name has been changed with a name tag.
Secondly, if you don't have a lot of entities, then you could just create a procedure for each entity involving the syringe... you could add if is event/target entity (name of entity), then set NBT string to (that entity's Minecraft id)
that was very usefull thank you, but if you know someway to do this same thing in the first exemple but with mobs id like "minecraft:minecraft" i would like to know too