Why isn't my trading GUI working?

Started by squib___ on Tue, 03/24/2020 - 05:36

Topic category: Help with modding (Java Edition)

Last seen on 13:51, 27. Oct 2020
Joined Mar 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Why isn't my trading GUI working?
Tue, 03/24/2020 - 05:36

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 13:51, 27. Oct 2020
Joined Mar 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 12:51, 27. Jul 2020
Joined Apr 2019
User points:

User statistics:

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