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

    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!

Bedstar

Member
May 23, 2025
4
0
1
ok so ive been trying to make a blast enchant where if you break 1 block it breaks the blocks around it in a radius [based on the level of enchant]

ive tried loop blocks but when i do:

Code:
on join:
    set {_blast} to {blast.%player%} ? 0
    # i have no idea what ? 0 does
    
on break:
    if {blast.%player%} = 1:
        if event-block is snow block:
            loop all blocks in radius 1 of event-block:
                if loop-block is snow:
                    set loop-block to bedrock
                    wait 1 seconds
                    set loop-block to snow block

it slowly sets each block in radius to bedrock and i have no way of setting every block at once.

i found a way scuffed way around this with:

Code:
on join:
    set {_blast} to {blast.%player%} ? 0
on break:
    if {blast.%player%} = 1:
        if event-block is snow block:
            set all blocks in radius 1 around event-block to bedrock
            set block below the event-block to air
            set block above the event-block to air
            wait 1 seconds
            set all blocks in radius 1 around event-block to snow block
            set block below the event-block to air
            set block above the event-block to air
    if {blast.%player%} = 2:   
        if event-block is snow block:
            set all blocks in radius 2 around event-block to bedrock
            set block below the event-block to air
            set block above the event-block to air
            wait 1 seconds
            set all blocks in radius 2 around event-block to snow block
            set block below the event-block to air
            set block above the event-block to air

but as you know it breaks when you do more than 1 radius cuz there is alot more blocks to remove 1 by 1.

however this method works if you use just 1 blast which is problematic when i want to add more items.

i also want it to give the player drops even on blast, how do i lock "chane of 10%" to loopblocks.
 
first of all, i have no idea why it says "? 0" there, you should change that to "to 0"
anyways, you can use "if block below block is snow block" or "if block left of block below block is bedrock" or "if block north of block is iron block" etc.

this might fix your problem
 
or if your idea is for it to not set the air to bedrock you could probably just do:
loop all blocks in radius 1 of event-block:
if loop-block is not air:
# Rest of the code here