command /coffre:
trigger:
loop 10000 times:
set {_x} to random number between -100 and 100
set {_y} to random number between 80 and 120
set {_z} to random number between -100 and 100
set {coffre} to location at {_x}, {_y}, {_z}
while block at {coffre} is not air:
add 1 to y-location of {coffre}
wait 1 tick
while block 1 block under {coffre} is air:
remove 1 from y-location of {coffre}
wait 1 tick
set block at {coffre} to chest
chance of 15%:
add 1 diamond to {_list.objet.random::*}
chance of 25%:
add 1 diamond sword to {_list.objet.random::*}
chance of 35%:
add 1 iron ingot to {_list.objet.random::*}
chance of 45%:
add 1 gold ingot to {_list.objet.random::*}
chance of 55%:
add 1 redstone block to {_list.objet.random::*}
chance of 85%:
add 1 diamond leggings to {_list.objet.random::*}
launch ball firework colored red at {coffre} timed 1 # Un feu d'artifice apparait à l'endroit du coffre
add {_list.objet.random::*} to inventory of block at {coffre} # On ajoute la liste des items dans le coffre
clear {_list.objet.random::*}
broadcast "&8&l[&c&lCoffre&8&l] &cUn coffre de loot est apparut en &7%{coffre}%" # Un message annonce les coordonnés du coffre
wait 0.01 seconds