AppleScript:
on right click:
if player's tool is black dye:
if name of player's tool is "&5Candy &8Bat":
if {cbcd.%player%} is not set:
remove black dye named "&5Candy &8Bat" from player
spawn a bat at player
set {_bat} to last spawned bat
broadcast "&6%player% has spawned a &5Candy &8Bat!"
apply slowness 255 without particles to {_bat} for 999999 days
set health of {_bat} to 200
set name of {_bat} to "&5Candy &8Bat"
set {cbcd.%player%} to 240
loop 2400 times:
set {cbcd.%player%} to {cbcd.%player%}-0.1
wait 0.1 seconds
delete {cbcd.%player%}
else:
send "&cOn cooldown for &e%{cbcd.%player%}%&c seconds!" to player
on damage:
broadcast "&ctest"
on damage:
broadcast "damage"
set {_bat} to victim
set {_rand} to a random number between 1 and 10
set {_rand} to round({_rand})
if {_rand} is 5:
kill {_bat}
broadcast "&6%player%'s bat has &cdied!"
else:
if attacker has a purple dye named "&5Candy talisman":
set {_rand} to a random number from 10 to 20
give attacker {_rand} amethyst shard named "&5Candy"
else:
set {_rand} to a random number from 2 to 10
give attacker {_rand} amethyst shard named "&5Candy"