I used a translator.
The number of cattle will continue to be zero when coded below.
What should I do?
%{;;s}% is #
The number of cattle will continue to be zero when coded below.
What should I do?
%{;;s}% is #
code_language.skript:
options:
prefix: &eAnimal&f>
command /animal [<text>]:
permission: lom.op
trigger:
if arg-1 is not set:
send "{@prefix} /animal wand &c-> &fGive a wand."
send "{@prefix} /animal check &c-> &fcheck number of animal"
else if arg-1 is "wand":
set {_wand} to feather named "&cAnimal Check Wand" with lore "Left click: select pos %{;;s}%1||Right click: select pos %{;;s}%2"
give 1 of {_wand} to player
send "{@prefix} Left click: select pos %{;;s}%1"
send "{@prefix} Right click: select pos %{;;s}%2"
else if arg-1 is "check":
if {animalcheck.pos1} is not set:
send "{@prefix} please select pos %{;;s}%1"
else if {animalcheck.pos2} is not set:
send "{@prefix} please select pos %{;;s}%2"
else:
set {_animals} to 0
loop all entities:
set {_loc} to loop-entity's location
set {_animals} to number of cows in {animalcheck.pos1} and {animalcheck.pos2}
send "Number of animals : %{_animals}%"
delete {animalcheck.pos1}
delete {animalcheck.pos2}
on leftclick:
if player has permission "lom.op":
set {_wand} to feather named "&cAnimal Check Wand" with lore "Left click: select pos %{;;s}%1||Right click: select pos %{;;s}%2"
if player's tool is {_wand}:
cancel event
set {_click} to event-location
if {_click} is not set:
stop
else:
cancel event
set {animalcheck.pos1} to event-location
send "{@prefix} First position set to %event-location%"
on rightclick:
if player has permission "lom.op":
set {_wand} to feather named "&cAnimal Check Wand" with lore "Left click: select pos %{;;s}%1||Right click: select pos %{;;s}%2"
if player's tool is {_wand}:
cancel event
set {_click} to event-location
if {_click} is not set:
stop
else:
cancel event
set {animalcheck.pos2} to event-location
send "{@prefix} Second position set to %event-location%"