Preventing giving items from output slot to player on GUI exit

Started by CluckNugget on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Preventing giving items from output slot to player on GUI exit

I've made a trading NPC where you can get 30-64 eggs every diamond you give to it through a GUI, but you can easily and even accidentally steal the amount of eggs the NPC offers by exiting out of the GUI while your diamonds are still in it and the eggs are in the output slot, resulting in you getting both back with no loss. The procedure that removes your diamonds relies on the "when item taken from slot" event, which does not trigger when you exit the GUI. How could I modify the GUI to disallow the eggs being taken via a GUI exit?

Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is the npc a living entity?
Thu, 08/03/2023 - 03:04

is the npc a living entity?

Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Actually, Sometimes it isn't…
Thu, 08/03/2023 - 15:29

Actually, Sometimes it isn't but for one case it is.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make it so you have to click…
Fri, 08/04/2023 - 01:53

Make it so you have to click a button or something, and then it will take the appropriate amount of diamonds, and put a certain amount of eggs in the output slot. I can give an example procedure

Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
tysm!! this helped me so…
Fri, 08/04/2023 - 04:49

tysm!! this helped me so much. Have a great day :D