I am trying to make a skript that does stuff when you click an item. But nothing is happening when I click the item?
Code:
on right click on a villager:
if name of clicked entity is "Oak Shop":
cancel event
open chest with 3 rows named "&8Oak Shop" to player
wait 1 tick
loop 30 times:
format slot loop-number of player with gray stained glass pane named " " to be unstealable
format slot 0 of player with gray stained glass pane named " " to be unstealable
format slot 11 of player with leather chestplate named "&eOak Gear" to be unstealable
format slot 13 of player with wooden axe named "&eOak Axes" to be unstealable
format slot 15 of player with an anvil named "&eCompressor" to be unstealable
on inventory click:
if inventory name of player's inventory is "&8Oak Shop":
cancel event
if event-slot is a leather chestplate:
close player's inventory
make player execute command "/shopkeeper open Real-Oak"
if event-slot is a wooden axe:
close player's inventory
make player execute command "/shopkeeper open Real-Oak2"
if event-slot is an anvil:
close player's inventory
make player execute command "/shopkeeper open Real-Oak3"