How to Randomise Chest Loot – Tutorial Series #006

Commands:
Step 1: Add and Display Scoreboard
1) /scoreboard objectives add chestloot dummy "§9Chest Loot"
2) /scoreboard objectives setdisplay sidebar chestloot

Step 2: Add Randomise Chest Button (input)
1) /scoreboard players random @a chestloot 1 5
2) /setblock (co-ordinates where you want the redstone block set) redstone_block

Step 3: Clone Chests (output)
1) /setblock ~ ~1 ~ air
2) /execute @a[scores={chestloot=1}] ~ ~ ~ clone (chest position cords) (chest position cords) (destination cords)
3) /execute @a[scores={chestloot=2}] ~ ~ ~ clone (chest position cords) (chest position cords) (destination cords)
4) /execute @a[scores={chestloot=3}] ~ ~ ~ clone (chest position cords) (chest position cords) (destination cords)
5) /execute @a[scores={chestloot=4}] ~ ~ ~ clone (chest position cords) (chest position cords) (destination cords)
6) /execute @a[scores={chestloot=5}] ~ ~ ~ clone (chest position cords) (chest position cords) (destination cords)
7) /particle minecraft:totem_particle 81 5 0 8) playsound random.levelup @a[r=20]

Write your comment Here