Multiple guis for one block/npc

Started by Raspad on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Multiple guis for one block/npc

Is it possible for one NPC to have multiple guis? 

 

I wanted to make a merchant NPC like custom npc. 

I made a similar set of slots as well as created a copy of the gui with some differences.

But it turns out that either the gui specified in the character itself opens or not one of the guis opens 

 

According to the idea, if with RMB on the NPC a store opens, and with RMB with a chicken feather in hand, the gui should open to configure the store.

 

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can make it a right…
Tue, 08/08/2023 - 11:33

You can make it a right click on entity action, instead of having a GUI bound to the NPC. But yeah, it wouldn't be bound then, so that wouldn't work.

My solution is to have it in one gui, and trade editing options appear only when the player is holding a feather. In my opinion a better way to start editing would be being in creative mode instead.

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In truth, I did not do such…
Wed, 08/09/2023 - 13:27

In truth, I did not do such logic in the gui itself, since I did not see any examples. 

 

PS. I looked at the description of the RMB trigger in the NPC .. most likely the problem here may be that this procedure is needed to tame some creatures .. And my RMB procedure returns the wrong data, which is why the selective opening of the GUI is not processed.