SOLVED "Shrink Item in main-hand of source entity" working incorrectly

Started by Soulside on

Topic category: Help with modding (Java Edition)

Last seen on 08:07, 8. Jul 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
SOLVED "Shrink Item in main-hand of source entity" working incorrectly
Sat, 01/06/2024 - 07:11 (edited)

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 Soulside on Sat, 01/06/2024 - 07:11
Last seen on 08:07, 8. Jul 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Update: The issue isn't…
Sat, 01/06/2024 - 06:46

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)

Last seen on 08:07, 8. Jul 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Update 2: It's actually both…
Sat, 01/06/2024 - 06:58

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