Why isn't my trading GUI working?

Started by squib___ on

Topic category: Help with modding (Java Edition)

Last seen on 01:33, 14. Mar 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Why isn't my trading GUI working?

Ok, so I'm making a mod with a small wandering-trader like mob. It has it's own GUI and item that it gives.
(The trade is 1 Apple -> 1 Spring)

The trade button, upon being clicked, should take away one apple from the player's inventory if they have one, and if they do have one, it should give a spring back.
It seems simple. But for whatever reason, the procedure just isn't working. It won't take away the apple or give the spring, even when I have 64 apples in my inventory.

(I don't see anything really.. wrong with the procedure. It's activated when the button is clicked.)
The GUI the mob uses for trading.

Last seen on 01:33, 14. Mar 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is it the player codeblocks?…
Tue, 03/24/2020 - 06:39

Is it the player codeblocks? Is it not finding a player? 

Last seen on 07:42, 26. Jun 2021
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You are checking mob…
Tue, 03/24/2020 - 07:55

You are checking mob inventory. Consider using gui with slots to implement trading