Started by
Apollo
on
Topic category: Help with Minecraft modding (Java Edition)
Hi everyone,
In my mod I'm trying to make a trade system where if you right-click a specific entity while holding an eligible item, it will take that item and give you something in return. When doing this while holding a single item it removes it properly, however while holding a stack of more than 1 of the item, it does the trade without taking the cost.
This is the procedure in question:
https://imgur.com/a/Ex3FAqe
Help would be much appreciated!
Solution:
I replaced the "shrink item in main hand of source entity for 1" block with "Remove 1 item from source entity main inventory" and now it all works fine
Edited by Apollo on Sat, 01/06/2024 - 07:11
Update:
The issue isn't having a stack of more than 1 item, but if the player already has at least 1 of the trade output in their inventory (the red book in this example) it doesn't consume the cost item (the book in this example)
Update 2:
It's actually both. If the player has more than 1 of the cost item OR already has an output item in their inventory then it doesn't consume the cost item when doing another trade