code_language.skript:
on break:
event-block is chest:
player is holding a blaze rod named "<gold>Randomize Chest":
cancel event
set {randomizechest::%event-block%} to true
on rightclick on chest:
{randomizechest::%event-block%} is true:
set {randomizechest::%event-block%} to false
set {_position} to 0
loop 27 times:
wait 1 ticks
open virtual chest inventory with size 3 named "Loot Chest" to the player
set {_itsl} to random integer between 1 and 10
if {_itsl} is 1:
set {_item} to wooden sword
if {_itsl} is 2:
set {_item} to leather chestplate
if {_itsl} is bigger than 2:
if {_itsl} is smaller than 11:
set {_item} to air
format gui slot {_position} of player with {_item} to close
add 1 to {_position}
Here is my code /\ - At the start it won't work, but this is supposed to create a random loot table chest, so each time you find a chest you will find this items. I found a bug that when I open the chest, all items that appears, dissappears after a few milliseconds and I don't want that.
Also I don't know how to make those items pickup-able.
Help!
Here a video of what happens: