Hi I'm trying to make prison enchants and I started with the explosive enchant:
command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player
on block break:
if "%region at event-block%" is "mine a":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop blocks in radius 2.5 of event-block:
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air
So far this works, but when the pickaxe is used outside of the region it still works. I was wondering how I could make this only occur within the region and not allow blocks around the region to break. Currently when I use it in the region it can break blocks around the region that aren't supposed to be broken and the pickaxe still works when it isn't in the region so I would like to prevent both of those things from happening.
I am using Skript version 2.5-beta2-MH, WorldGuard version 7.0.5-SNAPSHOT+2076-60b16fc, and WorldEdit version 7.2.0-SNAPSHOP+5445-beb784e
[doublepost=1602985366,1602965616][/doublepost]Small update and Bump:
I redid some of the skript so now it looks like this:
command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player
on block break:
if "%region at event-block%" contains "mine":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop all blocks in radius 2.5 around event-location:
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air
This only allows it to work when it is in the region. My problem is the skript loops blocks outside of the region and removes them. Any help would be appreciated!
I am using Skript version 2.5-beta2-MH, WorldGuard version 7.0.5-SNAPSHOT+2076-60b16fc, and WorldEdit version 7.2.0-SNAPSHOP+5445-beb784e
[doublepost=1602986517][/doublepost]Ended Up Working with:
command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player
on block break:
if "%region at event-block%" contains "mine":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop all blocks in radius 2.5 around event-location:
if "%region at loop-block%" contains "mine":
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air
command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player
on block break:
if "%region at event-block%" is "mine a":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop blocks in radius 2.5 of event-block:
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air
So far this works, but when the pickaxe is used outside of the region it still works. I was wondering how I could make this only occur within the region and not allow blocks around the region to break. Currently when I use it in the region it can break blocks around the region that aren't supposed to be broken and the pickaxe still works when it isn't in the region so I would like to prevent both of those things from happening.
I am using Skript version 2.5-beta2-MH, WorldGuard version 7.0.5-SNAPSHOT+2076-60b16fc, and WorldEdit version 7.2.0-SNAPSHOP+5445-beb784e
[doublepost=1602985366,1602965616][/doublepost]Small update and Bump:
I redid some of the skript so now it looks like this:
command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player
on block break:
if "%region at event-block%" contains "mine":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop all blocks in radius 2.5 around event-location:
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air
This only allows it to work when it is in the region. My problem is the skript loops blocks outside of the region and removes them. Any help would be appreciated!
I am using Skript version 2.5-beta2-MH, WorldGuard version 7.0.5-SNAPSHOT+2076-60b16fc, and WorldEdit version 7.2.0-SNAPSHOP+5445-beb784e
[doublepost=1602986517][/doublepost]Ended Up Working with:
command explosive:
trigger:
give a diamond pickaxe with lore "&7Explosive I" to the player
on block break:
if "%region at event-block%" contains "mine":
if player is holding a diamond pickaxe with lore "&7Explosive I":
loop all blocks in radius 2.5 around event-location:
if "%region at loop-block%" contains "mine":
add loop-block to {_explosive.%player%::*}
loop {_explosive.%player%::*}:
drop loop-value-1
set loop-block to air