I followed this video to get a system to allow players to fly in survival mode:

I modified the system by giving it a "toggle item' that allows the player to disable flying whenever they find it annoying or otherwise unwanted.

Sometimes whenever I use the toggle item the barrier block gets removed and the player falls to the ground as intended, but other times the barrier block remains and stays in the air, which means there's floating invisble blocks in midair, which is incredibly unwanted.

I'd prefer to just delete all barrier blocks within 10 blocks of the player whenever they stop flying, so I'd like you clever folks to help me.

How do I delete ALL Barrier blocks within 10 blocks of the player with command blocks?

execute @a ~ ~ ~ fill ~-10 ~-10 ~-10 ~10 ~10 ~10 air 0 replace barrier

That should clear a 20x20x20 blocks cube around the player of any barrier blocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.