Description
The Inventory Manager api is dumb/broken.
addItemToPlayer slot designation does not choose where to place an item and instead chooses from which slot to take the item in the originating inventory/chest.
This functionality is stupid because in the alternative function, removeItemFromPlayer, the slot designation chooses the slot in the inventory to take the item from. Thus, I assume the intended behaviour is for addItemToPlayer to also designate a slot in the player inventory to place it.
The api wiki also seems to suggest this is the case, so I assume something went horribly wrong and the behaviour was implemented incorrectly. please fix.
Steps to reproduce
- place down computer
- make lua script to place an item in player inventory via inventory manager.
manager.addItemToPlayer("UP", 1, 4, "minecraft:dirt")
- notice that instead of placing the dirt in slot 4, (in the hotbar according to removeItemFromPlayer), it instead takes the dirt from slot 4 from the chest, and places it in the first empty slot in your inventory.
-- > correct behaviour should be to take from any random slot with the item, or anything if no item designated, and to place said item into slot 4 of the inventory, or return an error if said slot is full/occupied. -1 slot designation should place it in the first empty slot in your inventory.
Multiplayer?
Yes
Version
0.7.2r (Latest)
Minecraft, Forge and maybe other related mods versions
Forge 36.2.6, Minecraft 1.16.5
Screenshots or Videos
No response
Crashlog/log
No response
Description
The Inventory Manager api is dumb/broken.
addItemToPlayer slot designation does not choose where to place an item and instead chooses from which slot to take the item in the originating inventory/chest.
This functionality is stupid because in the alternative function, removeItemFromPlayer, the slot designation chooses the slot in the inventory to take the item from. Thus, I assume the intended behaviour is for addItemToPlayer to also designate a slot in the player inventory to place it.
The api wiki also seems to suggest this is the case, so I assume something went horribly wrong and the behaviour was implemented incorrectly. please fix.
Steps to reproduce
manager.addItemToPlayer("UP", 1, 4, "minecraft:dirt")-- > correct behaviour should be to take from any random slot with the item, or anything if no item designated, and to place said item into slot 4 of the inventory, or return an error if said slot is full/occupied. -1 slot designation should place it in the first empty slot in your inventory.
Multiplayer?
Yes
Version
0.7.2r (Latest)
Minecraft, Forge and maybe other related mods versions
Forge 36.2.6, Minecraft 1.16.5
Screenshots or Videos
No response
Crashlog/log
No response