i want a command that will first see if the player has a command block in their inv then find the command blocks nbt tag and then remove the command for the certain command block from the used commands list and add it back to the available commands list and then execute as the player gems_random. also make it the player can do it only 3 times
the current skript i have (the one that triggers with gems_random)
command /gems_reset:
permission: gems.reset
permission message: you don't have permission
trigger:
set {commands::*} to "function gems:give/ender", "function gems:give/haste", "function gems:give/hover", "function gems:give/invisibility", "function gems:give/rang", "function gems:give/fire", "function gems:give/glow", "function gems:give/dog", "function gems:give/saturation", "function gems:give/godapple", "function gems:give/speed", "function gems:give/strength", "function gems:give/3" and "function gems:give/4"
command /gems_random:
permission: gems.random
permission message: you don't have permission
trigger:
if {commands::*} is not set:
execute console command "kick %player% no available gems"
else:
set {_f} to random element of {commands::*}
remove {_f} from {commands::*}
execute console command "execute as %player% run %{_f}%"
the current skript i have (the one that triggers with gems_random)
command /gems_reset:
permission: gems.reset
permission message: you don't have permission
trigger:
set {commands::*} to "function gems:give/ender", "function gems:give/haste", "function gems:give/hover", "function gems:give/invisibility", "function gems:give/rang", "function gems:give/fire", "function gems:give/glow", "function gems:give/dog", "function gems:give/saturation", "function gems:give/godapple", "function gems:give/speed", "function gems:give/strength", "function gems:give/3" and "function gems:give/4"
command /gems_random:
permission: gems.random
permission message: you don't have permission
trigger:
if {commands::*} is not set:
execute console command "kick %player% no available gems"
else:
set {_f} to random element of {commands::*}
remove {_f} from {commands::*}
execute console command "execute as %player% run %{_f}%"