How can I open a GUI when I right click on my custom entity

Started by abelcaron on

Topic category: Help with MCreator software

Active 4 years ago
Joined May 2020
Points:
629

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
How can I open a GUI when I right click on my custom entity

Hello,

I need to open a GUI when I right-click on my custom entity and since the new update I don't know how to do this anymore. I have created the right event but I have used this block: "open screen for Event/target entity pass location x: x y: y z: z GUI: BaseMenuVillager" and it didn't work.

Help me please.

Active 4 years ago
Joined Sep 2019
Points:
965

User statistics:

  • Modifications: 1
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 507
I would try to help you but…
Sun, 05/31/2020 - 16:52

I would try to help you but all I have is your description of the error can you please post code/images, please.

Active 4 years ago
Joined May 2020
Points:
629

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
thank you but this is not an…
Mon, 06/01/2020 - 10:49

thank you but this is not an error just tell me how can i open a gui when i rght click on a entity

Active 4 years ago
Joined Sep 2019
Points:
965

User statistics:

  • Modifications: 1
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 507
Does your gui have…
Mon, 06/01/2020 - 13:00

Does your gui have containers?

Active 4 years ago
Joined May 2020
Points:
629

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
No they have button 
Mon, 06/01/2020 - 15:55

No they have button 

Active 4 years ago
Joined Sep 2019
Points:
965

User statistics:

  • Modifications: 1
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 507
Ok, you shouldn't need to…
Mon, 06/01/2020 - 16:09

Ok, you shouldn't need to network so put this in your entity class (change the screen to your screen),

    public boolean processInteract(PlayerEntity player, Hand hand) {
        Minecraft.getInstance().displayGuiScreen(new YourScreenGui());
    }

This is what villagers use by the way.

Active 4 years ago
Joined May 2020
Points:
629

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
ok thanks  
Tue, 06/02/2020 - 16:46

ok thanks

 

Active 4 years ago
Joined Sep 2019
Points:
965

User statistics:

  • Modifications: 1
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 507
👍
Tue, 06/02/2020 - 17:22

👍