Custom Enchant: Layer

  • 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!

MrCowMan

Member
Aug 6, 2019
1
0
0
18
Category: Prison

Suggested name: Doesn't matter

Spigot/Skript Version: Version: 2.3.7

What I want:
I am making a prison server and have coded 12 of the 13 custom enchants, and the last one is layer which I have no idea how to do it. What layer should do is break an entire layer, but not break the bedrock, glowstone, quartz or into the other mines.

Ideas for commands: It wouldn't be a command it would be on a block break or mine

Ideas for permissions: No permissions, please

When I'd like it by: ASAP
 
i got u fam


Code:
on mine:
    if player's tool is a pickaxe:
        if {jh.level} is not set:
            set {jh.level} to 1
        set {_alllores::*} to lore of player's tool split at "||"
        set {_line} to 0
        loop {_alllores::*}:
            add 1 to {_line}
            if "%loop-value%" contains "Jackhammer":
                set {_jh.line} to line {_line} of lore of player's tool
                set {_jh.line.set} to uncolored {_jh.line}
                replace all " " in {_jh.line.set} with ""
                replace all "Jackhammer" in {_jh.line.set} with ""
                set {jh.level} to {_jh.line.set} parsed as an number
                set {_chance} to 0.00035*{jh.level}
                chance of {_chance}%:
                    set {_y} to y coordinate of event-block
                    loop blocks in radius 100 around event-block:
                        if "%region at loop-block%" contains "mine":
                            if y coordinate of loop-block = {_y}:
                                if {_n} is 750:
                                    set {_n} to 0
                                    wait 15 ticks
                                set {_n} to {_n} + 1
                                give player 1 of loop-block
                                set loop-block to air
                                add 1 to {experince.%{item}%.amount}
                                add 1 to {mined.%{item}%.amount}
                                set {_loc} to location of loop-block
                                drawDot count 1, particle "explosion", XYZ 0, 0, 0, center {_loc}, visibleRange 55, keepFor 0 ticks
 
  • Like
Reactions: malia