Started by
squib___
on
Topic category: Help with Minecraft modding (Java Edition)
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.)
Is it the player codeblocks? Is it not finding a player?
You are checking mob inventory. Consider using gui with slots to implement trading