Hello guys I have problems with Chest refill system , I get no erros 1.8 version of minecraft and 2.2 skript.
and it's doesn't work, but if this work i got just 3*10 same items from the list
Thank you
BTW If you can, you can do another system, What i need to do random slots and add items from the random list
code_language.skript:
set {_chestpatern} to a random integer between 1 and 4
if {_chestpatern} is 1:
loop all blocks in radius 20 of {sw.arena.%arg-2%.spawnpoint.11}:
if loop-block is a chest:
clear loop-block's inventory
loop (random integer between 3 and 10) times:
set {_slot} to a random number between 1 and 27
set {_item} to a random element of {chestitems.p1.::*}
add {_item} to block at loop-block
set slot {_slot} of loop-block to {_item}
if {_chestpatern} is 2:
loop all blocks in radius 20 of {sw.arena.%arg-2%.spawnpoint.11}:
if loop-block is a chest:
clear loop-block's inventory
loop (random integer between 3 and 10) times:
set {_slot} to a random number between 1 and 27
set {_item} to a random element of {chestitems.p2.::*}
add {_item} to block at loop-block
set slot {_slot} of loop-block to {_item}
if {_chestpatern} is 3:
loop all blocks in radius 20 of {sw.arena.%arg-2%.spawnpoint.11}:
if loop-block is a chest:
clear loop-block's inventory
loop (random integer between 3 and 10) times:
set {_slot} to a random number between 1 and 27
set {_item} to a random element of {chestitems.p3.::*}
add {_item} to block at loop-block
set slot {_slot} of loop-block to {_item}
if {_chestpatern} is 4:
loop all blocks in radius 20 of {sw.arena.%arg-2%.spawnpoint.11}:
if loop-block is a chest:
clear loop-block's inventory
loop (random integer between 3 and 10) times:
set {_slot} to a random number between 1 and 27
set {_item} to a random element of {chestitems.p4.::*}
add {_item} to block at loop-block
set slot {_slot} of loop-block to {_item}
Thank you
BTW If you can, you can do another system, What i need to do random slots and add items from the random list