#How can I add to an inventory above in the empty slot?

1 messages · Page 1 of 1 (latest)

half pilotBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

violet bear
#

insertItem returns an ItemStack containing the remaining items, so you can just loop through all the inventory slots until the stack is empty

let stack = Item.of('64x minecraft:cobblestone')
for(let i=0; i<event.block.inventory.slots; i++) {
  stack = event.block.inventory.insertItem(i, stack, false)
  if (stack.empty) return;
}