Inventory Manager removeItemFromPlayer function sees slot 0 as nil
Jeuvke opened this issue ยท 2 comments
Descripe
When using the removeItemFromPlayer
function with the slot argument set to 0
, it will instead act as if the slot argument was set to nil
. This means that if the item passed with argument 4 matches, but the item is in a slot other than 0, the item will still get removed.
Steps to reproduce
- Set up an Inventory Manager with a chest on top
- Put a Memory Card linked to you in the Inventory Manager
- Wrap the Inventory Manager to variable
IM
- Put a torch in your last hotbar slot, leave the rest of your inventory empty
- Run
IM.removeItemFromPlayer("up",1,1,"minecraft:torch")
- Observe that the torch is still in your inventory
- Run
IM.removeItemFromPlayer("up",1,nil,"minecraft:torch")
- Observe the torch got put in the chest
- Put the toch back in the last slot of your hotbar
- Run
IM.removeItemFromPlayer("up",1,0,"minecraft:torch")
- Observe that the torch got removed again, even though it wasn't in slot 0
Multiplayer?
Yes
Version
0.7.3r (Latest)
Minecraft, Forge and maybe other related mods versions
Forge 26.2.8, Minecraft 1.16.5
Screenshots or Videos
No response
Crashlog/log
No response