function getBlocks(1: location, 2: location) :: blocks:
set {_x} to 1
set {_y} to 1
set {_z} to 1
if x coord of {_1} > x coord of {_2}:
set {_x} to -1
if y coord of {_1} > y coord of {_2}:
set {_y} to -1
if z coord of {_1} > z coord of {_2}:
set {_z} to -1
set {_base1} to {_1}
loop abs(x coord of {_1} - x coord of {_2}) + 1 times:
loop abs(z coord of {_1} - z coord of {_2}) + 1 times:
loop abs(y coord of {_1} - y coord of {_2}) + 1 times:
add 1 to {_current}
set {_b::%{_current}%} to block at {_1}
add {_y} to y coord of {_1}
add {_z} to z coord of {_1}
set y coord of {_1} to y coord of {_base1}
add {_x} to x coord of {_1}
set z coord of {_1} to z coord of {_base1}
return {_b::*}
command /resetmine <text>: #this is the mine i had, eg. A, B, etc..
trigger:
add 1 to y coord of {loc1::%arg-1%} #{loc1} and {loc2... are the locations of the region i set
set {_x::*} to getBlocks({loc1::%arg-1%}, {loc2::%arg-1%})
loop {_x::*}:
set {_block} to a random element out of {blocks::%arg-1%::*}
set block at location of loop-value to {_block}
command /addblock <text> <text>:
trigger:
set {_block} to arg-2 parsed as item
add {_block} to {blocks::%arg-1%::*} #arg-1 is the mine, A, B, etc, I had something to select the region with sticks but I'm sure you could figure it out
message "&6&l(!) &6Added &e%arg-2% &6to &e%arg-1% &6mine!"