Vein miner

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Dec 3, 2024
2
0
1
23
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,

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.