#Inventory slot numbers?

1 messages · Page 1 of 1 (latest)

undone ice
#

Is there an image for slot numbers? This image is wrong as there are 41 items in inventory contents

zealous laurel
#

I think it's fine

tired bramble
#

Its fine

zealous laurel
#

If you need old version just use the history tab

tired bramble
undone ice
#

No I mean the slots are wrong

zealous laurel
#

Huh?

undone ice
#

The setContents method accepts at most an array of 41 items

tired bramble
#

yes those are raw slots

#

not relative to the inventory

#

you can;t set contents to the matrix

undone ice
#
var inventory = player.getInventory();
inventory.setContents(contents);
#

I can't do that?

tired bramble
#

yes

undone ice
#

So how do I just do something like that

tired bramble
#

you provide 41 items

#

0-8 are hotbar

undone ice
#

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

zealous laurel
#

You see

tired bramble
#

set contents accepts an array

undone ice
#

Yes

zealous laurel
#

Array of itemstacks

undone ice
#

Yes

#

I am passing a length 41 array of itemstacks

zealous laurel
#

Player has three different setContents don't they?

undone ice
#

4

zealous laurel
#

Player#setArmorContents
Player#setExtraContents
Player#setContents
Player#setStorageContents

tired bramble
#

what exactly are you trying to do?

undone ice
#

quite literally

#

*Defined trough a conf

tired bramble
#

ok, what are you calling the "contents"?

#

including armor and hotbar?

undone ice
#

Everything in the survival inv excluding crafting slots

zealous laurel
#

What's the value of #getSize() attribute for your case?

undone ice
tired bramble
#

then passing 41 is correct

zealous laurel
#

How about you debug it yourself first?

#

Try to set all the 41 thing as a item

#

and check which aren't filled

tired bramble
#

or tell us what its doing wrong

#

I'm goign to guess your item order is wrong

undone ice
#

Testing it again, but with debug logs now

zealous laurel
#

k let us know!

undone ice
#

I fixed it, I just accidentally typed a wrong number -_-

#

1 instead of 0 somewhere

zealous laurel
#

🤭

#

It's fine

thorn kettle
#

Which you can get them on inventoryclickevent

charred canopy