Safe zone around spawn

Monsters that walk within 30 blocks of spawn disappear, and players inside the zone cannot be hurt.

EasyWorld4 commandsEvery command accepted by the game (1.26.66.1)

You need

1Protect the area

Replace 0 64 0 with your own coordinates in all three commands.

Repeating block
/kill @e[family=monster,x=0,y=64,z=0,r=30]

Removes every hostile mob inside the radius.

Chain block
/effect @a[x=0,y=64,z=0,r=30] resistance 2 255 true

Players inside take no damage.

Chain block
/effect @a[x=0,y=64,z=0,r=30] saturation 2 0 true

And do not get hungry.

No command blocks? Use the function pack

This creation is included in the free 9Minecraft Command Creations behavior pack. Add the pack to your world, then type one command. It does the same thing as the command blocks above, driven by a tick function.

/function n9/spawn_safe_zone_on

Turns it on. All the setup commands from the steps above run for you.

/function n9/spawn_safe_zone_off

Turns it off again.

Download the pack (.mcpack) How to install it

How it works

Selector arguments x, y and z move the point that r is measured from, so the zone stays in place no matter where the command block is. The family=monster filter comes from the game data and covers zombies, skeletons, creepers and the rest in one word.

Make it your own

Turn it off

/gamerule commandblocksenabled false

Pauses the command blocks.

Commands used

More command creations

More from 9Minecraft

Command reference © 2026 9Minecraft.net. Syntax read from Minecraft Bedrock Edition 1.26.66.1.