Advanced Peripherals

Advanced Peripherals

29M Downloads

Inventory Manager removeItemFromPlayer function sees slot 0 as nil

Jeuvke opened this issue ยท 2 comments

commented

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

  1. Set up an Inventory Manager with a chest on top
  2. Put a Memory Card linked to you in the Inventory Manager
  3. Wrap the Inventory Manager to variable IM
  4. Put a torch in your last hotbar slot, leave the rest of your inventory empty
  5. Run IM.removeItemFromPlayer("up",1,1,"minecraft:torch")
  6. Observe that the torch is still in your inventory
  7. Run IM.removeItemFromPlayer("up",1,nil,"minecraft:torch")
  8. Observe the torch got put in the chest
  9. Put the toch back in the last slot of your hotbar
  10. Run IM.removeItemFromPlayer("up",1,0,"minecraft:torch")
  11. 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

commented

Inventory slots are confusing to me...

commented

Fixed in 0.7.4r