Sets the slot at the given index.
the item to set
a number in range 0..$
RangeError if an invalid index is given
if(inventory[1].empty || inventory[1].item != Items.BEETROOT) { inventory[1] = Slot(new Items.Beetroot()); }
See Implementation
Sets the slot at the given index.