Safe zones

Safe zones are WorldGuard regions. No combat starts inside them, nobody can hit or shoot into or out of them, and players in combat can’t get in. At the edge they see a glowing wall that only they can see.

Settings

These are under safe-zones: in config.yml. This is the default:

yaml
safe-zones:
  regions:
    - spawn
  # Also make every WorldGuard region with pvp set to deny a safe zone.
  pvp-off-regions: true
  # The wall a player in combat sees at the edge of a safe zone. Only that player sees it.
  wall:
    # Panel color, as HEX.
    color: "#FF3B3B"
    # How solid the panels get right next to the wall, from 0 to 100.
    opacity: 55
    # A glowing outline around every panel.
    outline: true
    outline-color: "#FF5555"
    # How close a player has to be to see the wall, in blocks.
    view-distance: 6
SettingMeaning
regions:WorldGuard region IDs that are safe zones. spawn by default. regions: [] removes them all.
pvp-off-regions: trueEvery WorldGuard region with pvp set to deny is a safe zone too. false uses only the listed regions.
color: "#FF3B3B"Color of the wall panels, as HEX.
opacity: 55How solid the panels get right next to the wall, from 0 (invisible) to 100.
outline: trueA glowing outline around every panel. false shows only the colored panels.
outline-color: "#FF5555"Color of the outline, as HEX.
view-distance: 6How close a player has to be to the edge to see the wall, in blocks, from 2 to 12.
WorldGuard is needed
Safe zones need WorldGuard. Without it, the console shows a warning and only disabled-worlds works.

Which regions count

  • Every region listed under regions:, whatever its flags are.
  • With pvp-off-regions: true, every region where pvp is deny, also when the region gets it from its parent region.
  • Region priority and child regions work like in WorldGuard, also for listed regions. An arena with pvp allow inside spawn is not a safe zone, as long as the arena has the higher priority or is a child of spawn.
  • The __global__ region is never a safe zone, so setting pvp deny on it doesn’t make the whole world safe.
  • Region changes are picked up within 5 seconds, no reload needed.

Hits at the edge

A melee hit or a projectile (arrows, tridents, splash potions and the like) is cancelled when the player who gets hit is inside a safe zone, or when the shot came from inside one. This works even when WorldGuard allows pvp in the region. Lava, fire, explosions and lingering potions aren’t cancelled by Combat Log.

The wall

  • A player in combat who comes near a safe zone sees a wall of see-through panels on its edge, one panel for every block. Nobody else sees it.
  • Only the part of the wall within view-distance blocks shows. Panels grow and get stronger as the player walks closer, and they pulse slowly in a wave.
  • The panels glow, so the wall is just as visible at night.
  • When combat ends, the wall shrinks and fades away.
  • The player stops at the wall like at a real block, without being pushed back.
  • Touching the wall shows safezone-blocked, at most once every 2 seconds, with the amethyst sound by default.

Nothing gets them in

Way inWhat happens
Walking, sprinting, jumpingThe wall stops them, and the server cancels any move into the zone.
Ender pearlsA pearl that lands inside the zone is removed before it teleports the player.
Chorus fruit, portals, end gateways, teleportsAny teleport into the zone is cancelled.
Horses, pigs, striders, camels, boats, minecartsThe player is taken off and sent back out.
Knockback, explosions, wind charges, riptide, pistons, slime blocksThe player is sent back to where they last were outside the zone.

Every tick, a player in combat who is inside a safe zone for any reason is sent back to the last spot in that world where they were outside it.