How to make it so when you enter a specific few regions your item gets removed.
Grallow opened this issue · 2 comments
/clear @A[x=x,y=y,z=z,dx=?,dy=?,dz=?] item
dx | Entities between x and x + dx.
dy | Entities between y and y + dy.
dz | Entities between z and z + dz.
source: https://www.digminecraft.com/getting_started/target_selectors.php
Selecting targets by volume
[dx=,dy=,dz=] — Filter target selection based on their x-difference, y-difference, and z-difference from some point, as measured by entities' hitboxes in Java Edition or by their feet in Bedrock Edition. Cannot duplicate any one of these three arguments.
This can be interpreted as creating a rectangular volume defined by an initial position (,,) and diagonal vector (,,), then selecting all entities whose hitboxes are at least partially contained by that volume in Java Edition, or whose feet are within that volume in Bedrock Edition. If the positional arguments are left out, the selection is interpreted as originating from the position of the command's execution. Any values are allowed, including signed and fractional numbers.
Note that dx,dy,dz specify signed differences from the given coordinate. They do not specify a separate coordinate, nor do they extend in both the positive and negative directions.
Additionally, when any volume argument is present, the rest are assumed to equal zero unless otherwise defined.
Examples in Java Edition:
@e[x=1,dx=4,y=2,dy=5,z=3,dz=6] — Select all entities whose hitbox collides with the block region (15, 27, 3~9) (or, mathematically speaking, the region that is {(x,y,z)∈R3|x∈[1.0,5.0),y∈[2.0,7.0),z∈[3.0,9.0)}).
@e[x=1,y=2,z=3,dx=0,dy=0,dz=0] — Select all entities whose hitbox contains the point (1,2,3).
/clear @A[x=x,y=y,z=z,dx=?,dy=?,dz=?] item
dx | Entities between x and x + dx.
dy | Entities between y and y + dy.
dz | Entities between z and z + dz.source: https://www.digminecraft.com/getting_started/target_selectors.php
Selecting targets by volume
[dx=,dy=,dz=] — Filter target selection based on their x-difference, y-difference, and z-difference from some point, as measured by entities' hitboxes in Java Edition or by their feet in Bedrock Edition. Cannot duplicate any one of these three arguments.
This can be interpreted as creating a rectangular volume defined by an initial position (,,) and diagonal vector (,,), then selecting all entities whose hitboxes are at least partially contained by that volume in Java Edition, or whose feet are within that volume in Bedrock Edition. If the positional arguments are left out, the selection is interpreted as originating from the position of the command's execution. Any values are allowed, including signed and fractional numbers.
Note that dx,dy,dz specify signed differences from the given coordinate. They do not specify a separate coordinate, nor do they extend in both the positive and negative directions.
Additionally, when any volume argument is present, the rest are assumed to equal zero unless otherwise defined.
Examples in Java Edition:
@e[x=1,dx=4,y=2,dy=5,z=3,dz=6] — Select all entities whose hitbox collides with the block region (15, 27, 3~9) (or, mathematically speaking, the region that is {(x,y,z)∈R3|x∈[1.0,5.0),y∈[2.0,7.0),z∈[3.0,9.0)}).
@e[x=1,y=2,z=3,dx=0,dy=0,dz=0] — Select all entities whose hitbox contains the point (1,2,3).
I think he meant using the built-in triggers that exist already which simply use events to detect the players location.
Read Title <3
You would want to use the region-egress
trigger to do this.
Upon entering a defined region the item will be removed, but upon exiting it will re-add the item.
If you simply want to remove it and not add it back use the region-remove
trigger.
Example;
example-item:
id: DIAMOND
slot: 0
triggers: region-engress
enabled-regions: region1, region2