Started by
LunarDxD
on
Topic category: Help with modding (Java Edition)
Hello, I have a mod with npcs tht you can tame and bring with you,
I wanted to make a GUI to change their state instead of just shift + right click to switch.
It's more convenient like this and pleasant for the player. (don't mind the placeholder ugly textures).
Unfortunately, i can't seem to target the specific entity with the GUi buttons and the procedures only change the player's NBT.
Is there a way to do so ?
Thanks you so much.
I have not messed around with this sort of stuff so this is just a guess. I assume you are right clicking the mob to open the GUI wheel.
Would potentially adding a procedure that when you right click the mob it adds a custom tag "guiopen" to that mob work. Then when you click one of the buttons have it so any mob in the area using "for each entity as entity iterator" that has "guiopen" as a tag, change their nbt tag as "entity iterator" "not event/target entity". Then also have it remove the "guiopen" tag as well at the end. That is my best guess
Oh my gosh thanks you @captainShark !! 🐟✨
You saved me so many time after i spent so many hours stuck on this, it works perfectly !
Glad it worked out, it truly was just a guess on my part lmao