Hey I have a question:
I'm trying to open a GUI with random items and the item that you click on should be given to the player. How do I do that? It doesn't work with me. This is my code:
command /randomitems:
trigger:
wait 1 tick
open chest with 1 rows named "Such dir ein Item aus" to player
wait 1 tick
format slot 0 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 1 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 2 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 3 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 4 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 5 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 6 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 7 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 8 of player with a random element out of all items to run [execute console command "custom-command"]
on inventory click:
if inventory name of player's current inventory is "Such dir ein Item aus":
if event-item is not barrier:
give event-item to player
command /custom-command:
trigger:
send "" to player
I'm trying to open a GUI with random items and the item that you click on should be given to the player. How do I do that? It doesn't work with me. This is my code:
command /randomitems:
trigger:
wait 1 tick
open chest with 1 rows named "Such dir ein Item aus" to player
wait 1 tick
format slot 0 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 1 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 2 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 3 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 4 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 5 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 6 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 7 of player with a random element out of all items to run [execute console command "custom-command"]
format slot 8 of player with a random element out of all items to run [execute console command "custom-command"]
on inventory click:
if inventory name of player's current inventory is "Such dir ein Item aus":
if event-item is not barrier:
give event-item to player
command /custom-command:
trigger:
send "" to player