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

Started by LunarDxD on

Topic category: Help with Minecraft modding (Java Edition)

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

 

 

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

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh my gosh thanks you …
Mon, 07/01/2024 - 13:35

Oh my gosh thanks you @captainShark !! 🐟✨

You saved me so many time after i spent so many hours stuck on this, it works perfectly !

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Glad it worked out, it truly…
Mon, 07/01/2024 - 14:25

Glad it worked out, it truly was just a guess on my part lmao