Started by
bananarang_mods
on
Topic category: Help with Minecraft modding (Java Edition)
I am making a mod that takes an item out of your inventory when you right-click on a block with the item (I used the [Remove [] [Item] from main inventory] block), it worked but it was always taking an item from the slot with the smallest ID instead of taking it from the stack in my hand (same with the off-hand, it takes from the smallest-ID slot that has the item rather than the off-hand). Is there an easy fix for this? Please tell me in the comments
Edited by bananarang_mods on Sat, 10/16/2021 - 14:54
set item in main hand of event target entity to get items in|main hand of event target entity - 1 Item in main hand of event target entity
basically this should be your procedure: if item in main hand of event target entity = ITEM
do Procedure Above
else remove 1 from event target entity inventory