# How do I fill an area relative to the players position

[MINECRAFT 1.8.9]

So I have an endportal constantly spawning 4 blocks above the player with this command:

``````/execute @a ~ ~ ~ setblock ~ ~4 ~ minecraft:end_portal
``````

and I want the portal to disappear when I move one block away in any direction from it so that it "follows you".

So I have these commands running on a fast clock:

``````execute @a ~ ~ ~ fill ~-3 ~ ~-1 ~3 ~ ~-3 air 0 replace end_portal

execute @a ~ ~ ~ fill ~-3 ~ ~1 ~3 ~ ~3 air 0 replace end_portal

execute @a ~ ~ ~ fill ~1 ~ ~ ~3 ~ ~ air 0 replace end_portal

execute @a ~ ~ ~ fill ~-1 ~ ~ ~-3 ~ ~ air 0 replace end_portal
``````

These are supposed to remove all endportals around you but not above or below your current position

For some reason it's not working

I forgot the height in these commands:

``````execute @a ~ ~ ~ fill ~-3 ~30 ~-1 ~3 ~ ~-3 air 0 replace end_portal

execute @a ~ ~ ~ fill ~-3 ~30 ~1 ~3 ~ ~3 air 0 replace end_portal

execute @a ~ ~ ~ fill ~1 ~30 ~ ~3 ~ ~ air 0 replace end_portal

execute @a ~ ~ ~ fill ~-1 ~30 ~ ~-3 ~ ~ air 0 replace end_portal
``````

I added `30` to the `Y` of each of them.

• Does that solve the problem? Aug 9, 2017 at 23:33