help with using a GUI to changean entity's NBT tags

Started by LunarDxD on

Topic category: Help with modding (Java Edition)

Last seen on 07:00, 27. Jun 2024
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
help with using a GUI to changean entity's NBT tags

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.

 

https://imgur.com/a/3O80oXk

 

https://imgur.com/a/d8Bu5Zr

 

https://imgur.com/a/AsktLjP

 

 

Last seen on 22:03, 29. Jun 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have not messed around…
Thu, 06/27/2024 - 07:41

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