How do I put an item into an inventory slot in minecraft 1.15? I have been looking in the forum and in the documentation but I could not put an item.
Code:
on rightclick on a crafting table:
if player is sneaking:
cancel the event
send "<red>!!!" to player
else:
play sound "block.beacon.activate" with volume 10 to the player
send "<green>Crafting table open!" to player
set {_inventory} to chest inventory with 6 row
set slot 0 of {_inventory} inventory to diamond sword
wait 0.1 ticks
open chest inventory with 6 row named "Crafting Table" to player
an image of the inventory: https://prnt.sc/tav7rn