Commit 0e3284c0 authored by Tommy Ang's avatar Tommy Ang 🤣

Implement beacon protection, minecart storage protection, vehicle protection

parent 8caa9882
......@@ -1405,15 +1405,24 @@ on HangingBreakByEntityEvent:
if {_hasPermission} is false:
cancel event
on right click on chest or trapped chest or furnace or dispenser or dropper or cauldron or jukebox or hopper or brewing stand or any shulker box or any fence gate or any door or barrel:
on right click on chest or trapped chest or furnace or dispenser or dropper or cauldron or jukebox or hopper or brewing stand or any shulker box or any fence gate or any door or barrel or beacon:
set {_chunk} to chunk at event-block
set {_player} to player
set {_haspermission} to hasPermission({_chunk}, {_player}, "interact")
if {_hasPermission} is false:
cancel event
# Minecart with storage protection
on right click:
if "%event-entity%" is "minecart" or "horse" or "llama" or "donkey":
set {_chunk} to chunk at event-entity
set {_player} to player
set {_haspermission} to hasPermission({_chunk}, {_player}, "interact")
if {_hasPermission} is false:
cancel event
on right click on an armor stand:
set {_chunk} to chunk at event-block
set {_chunk} to chunk at event-entity
set {_player} to player
set {_haspermission} to hasPermission({_chunk}, {_player}, "interact")
if {_hasPermission} is false:
......@@ -1447,7 +1456,22 @@ on rightclick holding LINGERING POTION or SPLASH POTION:
message "{@Prefix} &4这不是您的小镇!"
else:
message "{@Prefix} &4This is not your town!"
# Boat, Minecart
on vehicle destroy:
set {_chunk} to chunk at event-location
set {_player} to player
set {_haspermission} to hasPermission({_chunk}, {_player}, "build")
if {_hasPermission} is false:
cancel event
on vehicle enter:
set {_chunk} to chunk at event-location
set {_player} to player
set {_haspermission} to hasPermission({_chunk}, {_player}, "build")
if {_hasPermission} is false:
cancel event
on damage:
# if {prun.start} is 1:
# if {prun.join.%victim%} is 1:
......@@ -1470,7 +1494,7 @@ on damage:
set {_ptowndamagechunk} to {ptown.%attacker%}
victim is not a creeper or a zombie or a skeleton or a spider or an enderman or a cave spider or a witch or a phantom or a drowned
# PvP disable
if attacker is a player:
if attacker is a player:
if {ptown.%attacker%} is not set:
if {ptownlist.chunk::%chunk of victim%} is set:
cancel event
......
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