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

Started by abelcaron on Sun, 05/31/2020 - 16:02

Topic category: Help with MCreator software

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How can I open a GUI when I right click on my custom entity
Sun, 05/31/2020 - 16:02

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.

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
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.

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
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

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

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

Does your gui have containers?

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

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

No they have button 

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
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.

Last seen on 20:14, 19. Aug 2020
Joined May 2020
Points:

User statistics:

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

ok thanks

 

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
👍
Tue, 06/02/2020 - 17:22

👍