Started by
gustavowizard123
on
Topic category: Help with Minecraft modding (Java Edition)
Hey guys im trying to set up a procedure for a item (on right clicked) on a mob capture its (maybe using those NBT tags) and so on... do i need 2 itens or just 1?
i want this to make on any entity, vanilla or mod ones.
can someone gimme a hand? thanks!
what do you mean by capture it? gotta give details
He means he wants to set an NBT tag == to the Entity. There are many details, and here is one;
You can do this easily in Java, in fact, I do it in my mod;
https://mcreator.net/modification/63126/infused-stones-mod
However, it involves iterations and some events. So, to save my time, I won't show an example or give code unless you are ready! 🥰 Let me know if you want to do it.
lol yeah i want it! thanks!
like on most mods, you right click the mob with the net or magic bottle wtv then the mob despawn and you get a tag ID on the item, then you can move the mob to your house and stuff, i know how to do it using 1 new item for each mob, but i got 80 mobs + the vanillas and i want it to work on mobs of any mod.
is your mod on curseforge tbroski ?
im ready what should i do? thanks!
well in that case nbt tags won't be enough. you will need to make a copy of the captured entity and then despawn it. the copy is a full Entity so you can spawn it somewhere else easily. you can check how vanilla does it when teleporting entities to other dimensions
make a copy of the entity you mean by Mcreator Procedure or by editing the code?
also where do i find that code, you mean when mobs enter the portal by acident?
by editing code. look in net.minecraft.entity.Entity.java starting from line 2437. looks simple enough. of course the entity won't get saved on world shutdown, for that you'll need to save the nbt data of that entity somewhere.
bummer i was not able to do like that.. im still trying to make with procedures, but i dont understand what those NBT data and logic tags are
then learn on the wikis lmao
i can make it work but only using 1 element Item for each mob (that would be much more time consuming and plus wont work on other mods, just my own and vanilla mobs)
i read the wiki info, nothing there shows how to set this up... :(
could you help me?