options:
# change the coordinates to your safe zone corners (top right and bottom left for example)
# also change the world name to the world of your safe zone
pos1: 0, 0, 0, world("world")
pos2: 100, 100, 100, world("world")
on spawn:
if event-entity is within {@pos1} and {@pos2}:
cancel event
on damage:
if victim is within {@pos1} and {@pos2}:
cancel event
try this