Commit ee37269c authored by Tommy Ang's avatar Tommy Ang 🤣

Prevent creeper explosion when there's town within radius of 1

parent ade7de93
......@@ -1551,6 +1551,24 @@ on PlayerInteractEvent:
on explode:
if {ptownlist.chunk::%chunk at event-location%} is "Safezone":
cancel event
if "%entity%" contains "creeper":
if {ptownlist.chunk::%chunk at event-location%} is set:
cancel event
set {_mapX} to 1
set {_mapY} to 1
loop 3 times:
loop 3 times:
set {_Y} to {_mapY} * 16
set {_X} to {_mapX} * 16
set {_block} to block {_Y} north of entity
set {_block} to block {_X} west of {_block}
set {_chunk} to chunk at {_block}
if {ptownlist.chunk::%{_chunk}%} is set:
cancel event
stop
subtract 1 from {_mapX}
subtract 1 from {_mapY}
set {_mapX} to 1
on spawn of a creeper or a zombie or a spider or an enderman or a witch or a cow or a rabbit or a sheep or a wolf or a chicken or an ocelot or a pig or a phantom or a skeleton:
if {ptownlist.chunk::%chunk at event-location%} is "Safezone":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment