Getting the entity a player is viewing the GUI of.

Started by deemosor on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Getting the entity a player is viewing the GUI of.

So basically, i want players to be able to put armor on my custom entity through a GUI. However, by using the "event/target" block it refers to me instead of the entity i'm checking the GUI of. The armor is still left in it's GUI. I believe the items is saved locally per the entities GUIs but i cant find the armor item while trying to find it through their inventories.

 

So i want the armor to behave exactly like the vanilla horses do. When the armor is placed in it's inventory/GUI, it will change into its armored texture (hopefully).

 

Have been searching for a while on how to do this with no luck :/, so anything helps.

Thanks in advance.