3x3x3 blast mining and telekinesis

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

DrunkSheep73

Member
May 29, 2023
24
2
3
22
Hello everyone!
I need help with my skript:
Code:
on mine:
    if player's held item is netherite pickaxe named "&cBlast I":
        if event-block is netherrack or bedrock or nether bricks or black stained glass or nether wart block or magma block:
            cancel event
            send "&cHey! &8You can't do that!" to player
        else:
            set {_1} to location of event-block
            set {_2} to location of event-block
            if player's pitch is between -50 and 50:
                add 1 to y-coord of {_1}
                subtract 1 from y-coord of {_2}
                if player's horizontal facing is west or east:
                    add 1 to z-coord of {_1}
                    subtract 1 from z-coord of {_2}
                    add 1 to x-coord of {_1}
                    subtract 1 from x-coord of {_2}
                    loop blocks within {_1} and {_2}:
                        if loop-value contains black stained glass or magma block or nether bricks or nether wart block or netherrack or bedrock:
                            cancel event
                        else:
                            set loop-value to air
                            clear drops
                            give player event-block
                else if player's horizontal facing is north or south:
                    add 1 to x-coord of {_1}
                    add 1 to z-coord of {_1}
                    subtract 1 from x-coord of {_2}
                    subtract 1 from z-coord of {_2}
                    loop blocks within {_1} and {_2}:
                        if loop-value contains black stained glass or netherrack or magma block or nether bricks or nether wart block or bedrock:
                            cancel event
                            send "&cHey! &8You can't do that!" to player
                        else:
                            set loop-value to air
                            clear drops
                            give player event-block
            else:
                add 1 to x-coord of {_1}
                add 1 to z-coord of {_1}
                subtract 1 from x-coord of {_2}
                subtract 1 from z-coord of {_2}
                add 1 to y-coord of {_1}
                subtract 1 from y-coord of {_2}
                loop blocks within {_1} and {_2}:
                    if loop-blocks contains black stained glass or magma block or netherrack or nether bricks or nether wart block or bedrock:
                        cancel event
                        send "&cHey! &8You can't do that!" to player
                        remove all netherrack from player
                    else:
                        set loop-blocks to air
                        clear drops
                        give player event-block
This gives no errors but if you mine a block, you always get 13 and I want you get the count of blocks you mined.

Thank you for help!
[doublepost=1685861987,1685432667][/doublepost]Is this too hard or why do I don't get replies?
 
that gives a error:

Code:
[15:01:27 INFO]: [Skript] Reloading blast.sk...
[15:01:27 INFO]: Line 52: (blast.sk)
[15:01:27 INFO]:     'else' has to be placed just after another 'if' or 'else if' section
[15:01:27 INFO]:     Line: else:
[15:01:27 INFO]: 
[15:01:27 INFO]: [Skript] Encountered 1 error while reloading blast.sk! (159ms)
 
Last edited:
Code:
loop {_blocksWhatNeedToBeMined::*}:
  loop drops of block using player's tool:
    if player has space for loop-value-2:
      give loop-value-2 to player
    else:
      drop loop-value-2 at loop-value-1
  set block at loop-value to air
 
Is this what you mean?
Code:
on mine:
    if player's held item is netherite pickaxe named "&cBlast I":
        if event-block is netherrack or bedrock or nether bricks or black stained glass or nether wart block or magma block or barrier or shulker box:
            cancel event
            send "&c&lHey! &r&8You can't do that!" to player
        else:
            set {_1} to location of event-block
            set {_2} to location of event-block
            if player's pitch is between -50 and 50:
                add 1 to y-coord of {_1}
                subtract 1 from y-coord of {_2}
                if player's horizontal facing is west or east:
                    add 1 to z-coord of {_1}
                    subtract 1 from z-coord of {_2}
                    add 1 to x-coord of {_1}
                    subtract 1 from x-coord of {_2}
                    loop blocks within {_1} and {_2}:
                        if loop-value contains black stained glass or magma block or nether bricks or nether wart block or netherrack or bedrock or barrier or shulker box:
                            cancel event
                            send "&c&lHey! &r&8You can't do that!" to player
                        else:
                            set loop-value to air
                            clear drops
                            give player event-block
                else if player's horizontal facing is north or south:
                    add 1 to x-coord of {_1}
                    add 1 to z-coord of {_1}
                    subtract 1 from x-coord of {_2}
                    subtract 1 from z-coord of {_2}
                    loop blocks within {_1} and {_2}:
                        if loop-value contains black stained glass or netherrack or magma block or nether bricks or nether wart block or bedrock or barrier or shulker box:
                            cancel event
                            send "&c&lHey! &r&8You can't do that!" to player
                        else:
                            set loop-value to air
                            clear drops
                            give player event-block
            else:
                add 1 to x-coord of {_1}
                add 1 to z-coord of {_1}
                subtract 1 from x-coord of {_2}
                subtract 1 from z-coord of {_2}
                add 1 to y-coord of {_1}
                subtract 1 from y-coord of {_2}
                loop {_blocksWhatNeedToBeMined::*}:
                    loop drops of block using player's tool:
                        if player has space for loop-value-2:
                            give loop-value-2 to player
                        else:
                            drop loop-value-2 at loop-value-1
                            set block at loop-value to air
                            if loop-blocks contains black stained glass or magma block or netherrack or nether bricks or nether wart block or bedrock or barrier or shulker box:
                                cancel event
                                send "&c&lHey! &r&8You can't do that!" to player
                            else:
                                set loop-blocks to air
                                clear drops
                                give player loop-block
Errors:
Code:
[18:46:14 INFO]: [Skript] Reloading blast.sk...

[18:46:15 INFO]: Line 51: (blast.sk)

[18:46:15 INFO]:     There are multiple loops that match loop-value. Use loop-value-1/2/3/etc. to specify which loop's value you want.

[18:46:15 INFO]:     Line: set block at loop-value to air

[18:46:15 INFO]: 

[18:46:15 INFO]: Line 52: (blast.sk)

[18:46:15 INFO]:     There's no loop that matches 'loop-blocks'

[18:46:15 INFO]:     Line: if loop-blocks contains black stained glass or magma block or netherrack or nether bricks or nether wart block or bedrock or barrier or shulker box:

[18:46:15 INFO]: 

[18:46:15 INFO]: Line 55: (blast.sk)

[18:46:15 INFO]:     'else' has to be placed just after another 'if' or 'else if' section

[18:46:15 INFO]:     Line: else:

[18:46:15 INFO]: 

[18:46:15 INFO]: [Skript] Encountered 3 errors while reloading blast.sk! (1204ms)
 
Is this what you mean?
Code:
on mine:
    if player's held item is netherite pickaxe named "&cBlast I":
        if event-block is netherrack or bedrock or nether bricks or black stained glass or nether wart block or magma block or barrier or shulker box:
            cancel event
            send "&c&lHey! &r&8You can't do that!" to player
        else:
            set {_1} to location of event-block
            set {_2} to location of event-block
            if player's pitch is between -50 and 50:
                add 1 to y-coord of {_1}
                subtract 1 from y-coord of {_2}
                if player's horizontal facing is west or east:
                    add 1 to z-coord of {_1}
                    subtract 1 from z-coord of {_2}
                    add 1 to x-coord of {_1}
                    subtract 1 from x-coord of {_2}
                    loop blocks within {_1} and {_2}:
                        if loop-value contains black stained glass or magma block or nether bricks or nether wart block or netherrack or bedrock or barrier or shulker box:
                            cancel event
                            send "&c&lHey! &r&8You can't do that!" to player
                        else:
                            set loop-value to air
                            clear drops
                            give player event-block
                else if player's horizontal facing is north or south:
                    add 1 to x-coord of {_1}
                    add 1 to z-coord of {_1}
                    subtract 1 from x-coord of {_2}
                    subtract 1 from z-coord of {_2}
                    loop blocks within {_1} and {_2}:
                        if loop-value contains black stained glass or netherrack or magma block or nether bricks or nether wart block or bedrock or barrier or shulker box:
                            cancel event
                            send "&c&lHey! &r&8You can't do that!" to player
                        else:
                            set loop-value to air
                            clear drops
                            give player event-block
            else:
                add 1 to x-coord of {_1}
                add 1 to z-coord of {_1}
                subtract 1 from x-coord of {_2}
                subtract 1 from z-coord of {_2}
                add 1 to y-coord of {_1}
                subtract 1 from y-coord of {_2}
                loop {_blocksWhatNeedToBeMined::*}:
                    loop drops of block using player's tool:
                        if player has space for loop-value-2:
                            give loop-value-2 to player
                        else:
                            drop loop-value-2 at loop-value-1
                            set block at loop-value to air
                            if loop-blocks contains black stained glass or magma block or netherrack or nether bricks or nether wart block or bedrock or barrier or shulker box:
                                cancel event
                                send "&c&lHey! &r&8You can't do that!" to player
                            else:
                                set loop-blocks to air
                                clear drops
                                give player loop-block
Errors:
Code:
[18:46:14 INFO]: [Skript] Reloading blast.sk...

[18:46:15 INFO]: Line 51: (blast.sk)

[18:46:15 INFO]:     There are multiple loops that match loop-value. Use loop-value-1/2/3/etc. to specify which loop's value you want.

[18:46:15 INFO]:     Line: set block at loop-value to air

[18:46:15 INFO]:

[18:46:15 INFO]: Line 52: (blast.sk)

[18:46:15 INFO]:     There's no loop that matches 'loop-blocks'

[18:46:15 INFO]:     Line: if loop-blocks contains black stained glass or magma block or netherrack or nether bricks or nether wart block or bedrock or barrier or shulker box:

[18:46:15 INFO]:

[18:46:15 INFO]: Line 55: (blast.sk)

[18:46:15 INFO]:     'else' has to be placed just after another 'if' or 'else if' section

[18:46:15 INFO]:     Line: else:

[18:46:15 INFO]:

[18:46:15 INFO]: [Skript] Encountered 3 errors while reloading blast.sk! (1204ms)
No. You have code to get blocks what need mine
Add every block, what need to be mined to list, like
Code:
add %block% to {_someblocklist::*}
Then ,
Code:
loop {_someblocklist::*}:
  loop drops of block using player's tool:
    if player has space for loop-value-2:
      give loop-value-2 to player
    else:
      drop loop-value-2 at loop-value-1
  set block at loop-value to air