#Inventory slot numbers?
1 messages · Page 1 of 1 (latest)
Is it wrong tho?
I think it's fine
Its fine
No I mean the slots are wrong
Huh?
The setContents method accepts at most an array of 41 items
yes those are raw slots
not relative to the inventory
you can;t set contents to the matrix
var inventory = player.getInventory();
inventory.setContents(contents);
I can't do that?
yes
So how do I just do something like that
Wait pause, so I can use an array? or do I need to iterate and set the slot for each entry
I am not understanding at all lmao
You see
set contents accepts an array
Yes
Array of itemstacks
Player has three different setContents don't they?
Player#setArmorContents
Player#setExtraContents
Player#setContents
Player#setStorageContents
what exactly are you trying to do?
Given an array of contents for the player inventory, set them in the player's inventory
quite literally
*Defined trough a conf
Everything in the survival inv excluding crafting slots
What's the value of #getSize() attribute for your case?
Yeah ig
41 iirc
then passing 41 is correct
How about you debug it yourself first?
Try to set all the 41 thing as a item
and check which aren't filled
Testing it again, but with debug logs now
k let us know!
These are the raw slots of inventory
Which you can get them on inventoryclickevent
Do you need to access the crafting and armour slots? If not, you can cast a player inventory to a normal inventory to get only the 0-36 slots, I don't know if that is right
i made this some time ago