Ive been trying to make a vein miner skript for the last 4 hours and trying to copy off of others but all of their skripts either have a max radius for the ore vein or reaches veins 2 blocks away. What im trying to do is make a skript where it makes a snowball effect by checking each block next to the one you mined then checking the ones next to the one you mined and so on to break all the ore.
This is what i managed to do,
Any help would be greatly appreciated.
This is what i managed to do,
Code:
function checkAround(veinloc: location):
if {i} is 1:
set {new_event_blockVein} to block above {veinloc}
if {i} is 2:
set {new_event_blockVein} to block left of {veinloc}
if {i} is 3:
set {new_event_blockVein} to block right of {veinloc}
if {i} is 4:
set {new_event_blockVein} to block under {veinloc}
if {i} is 5:
set {new_event_blockVein} to block infront of {veinloc}
if {i} is 6:
set {new_event_blockVein} to block behind {veinloc}
#send "&b&l%{veinloc}% &rspace %{repeat}% &rspace %{i}% &rspace &a&l%{new_event_blockVein}%" to "RoyalTurtleMan" parsed as player
function veinMiner(p: player):
set {i} to 0
loop 6 times:
set {i} to {i} + 1
checkAround({veinloc})
if "%type of {new_event_blockVein}%" contains {_type}:
break block at {new_event_blockVein}
veinMiner({_p})
chance of 50%:
set {_p}'s food level to {_p}'s food level - 0.5
on mine:
if {forager_%player%} is true:
set {veinloc} to event-block
set {_type} to "%type of event-block%"
if {_type} contains "ore":
veinMiner(player)
Any help would be greatly appreciated.