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

Started by Apollo on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 month ago
Joined Jan 2024
Points:
201

User statistics:

  • Modifications: 0
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 25
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 Apollo on Sat, 01/06/2024 - 07:11
Active 1 month ago
Joined Jan 2024
Points:
201

User statistics:

  • Modifications: 0
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 25
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)

Active 1 month ago
Joined Jan 2024
Points:
201

User statistics:

  • Modifications: 0
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 25
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