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

Fix crop trample issue, fix #42

parent 6643c825
......@@ -6,11 +6,8 @@
#variables:
command /vc <text>:
permission: op
trigger:
message "%{%arg 1%}%"
stop
import:
org.bukkit.event.player.PlayerInteractEvent
command /potatotown <text="help"> [<text>]:
aliases: ptown
......@@ -1601,16 +1598,22 @@ on death:
clear drops
clear {ptown.death.%victim%}
# on crop trample:
# event-crop is wheat or melon stem or pumpkin stem or potato plant or seeds
# if {ptownlist.chunk::%chunk at block%} is "Safezone":
# cancel event
# if "%{ptownlist.chunk::%chunk at block%}%" is not equal to "%{ptown.%player%}%":
# if {language.%player%} is "chinese":
# message "[&6PTown&f] 您不能在这里践踏庄稼!"
# if {language.%player%} is "english":
# message "[&6PTown&f] You are not allowed to trample crops here!"
# cancel event
# Crop Trample
on PlayerInteractEvent:
# Check for soil block
"%event.getClickedBlock()%" is "soil block"
# Check for non wilderness chunk
{ptownlist.chunk::%chunk at event.getClickedBlock()%} is set
# Prevent safezone griefing
if {ptownlist.chunk::%chunk at event.getClickedBlock()%} is "Safezone":
cancel event
# Prevent griefing of other town
if "%{ptownlist.chunk::%chunk at event.getClickedBlock()%}%" is not equal to "%{ptown.%event.getPlayer()%}%":
if {language.%event.getPlayer()%} is "chinese":
message "[&6PTown&f] 您不能在这里践踏庄稼!" to event.getPlayer()
if {language.%event.getPlayer()%} is "english":
message "[&6PTown&f] You are not allowed to trample crops here!" to event.getPlayer()
cancel event
on explode:
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