Solved Enchant fail

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

Status
Not open for further replies.

HedgeCrumbs65

Member
Jan 26, 2023
3
0
1
45
I'm trying to make a custom enchants plugin and I tried to make an enchant that breaks all blocks in a 3x3 radius. It doesn't give me any errors but doesn't do anything. My code's below.

Code:
on block break:
    if lore of player's held item contains "&8- &eBlast I &8-":
        loop all blocks around player in radius 3:
            if {@cant-break} contains loop-block:
                send "&cYou can't use Blast on %loop-block%!"
            else:
                break block at location of loop-block

The addons I have installed are skRayFall and skUtilities.
 
I'm trying to make a custom enchants plugin and I tried to make an enchant that breaks all blocks in a 3x3 radius. It doesn't give me any errors but doesn't do anything. My code's below.

Code:
on block break:
    if lore of player's held item contains "&8- &eBlast I &8-":
        loop all blocks around player in radius 3:
            if {@cant-break} contains loop-block:
                send "&cYou can't use Blast on %loop-block%!"
            else:
                break block at location of loop-block

The addons I have installed are skRayFall and skUtilities.
is the skript detecting the lore? / if someone has that enchantment?
 
From personal testing, you code seems to work, granted, I have another addon (SkBee) installed.
I would suggest that you change the initial location of the radius to the broken block (changing "loop all blocks around player in radius 3:" to "loop all blocks around target block in radius 3:").
I have also seen that this creates a sphere around the location you're looping around instead of a 3x3 area. I'm in the process of modifying your code to adjust to these changes (I did make it a 3x3x3 as that's what most are used for, but if you want me to change it, I will be happy to).

You could also attempt to implement this yourself, but if you would rather just getting the pre-written code, just reply, Hope this helps!
 
Status
Not open for further replies.