this is all it says when i activate it and the cooldown value does seem to change
set {_uuid} to uuid of {_p}
#broadcast getCooldownVar({_cooldown}) - System.currentTimeMillis()
if {_bookab} is "enhanced_sharpness":
if difference between now and {bookcd::%{_uuid}%} <= 90 seconds:
return true
else if difference between now and {bookcd::%{_uuid}%} = 90 seconds:
return true
else:
return false
function setCooldown(cooldown: player, value: int, active: int):
set {_uuid} to uuid of {_cooldown}
set {_v} to seconds of {_value}
set {_a} to seconds of {_active}
set {activecd::%{_uuid}%} to now + {_a}
set {bookcd::%{_uuid}%} to now + {_v} + {_a}
broadcast "%{activecd::%{_uuid}%}% : this is acvtive cooldown :)"
broadcast "%{bookcd::%{_uuid}%}% : this is actual cooldown :)"
function bookability(p: player, bookab: string):
set {_uuid} to uuid of {_p}
if canUsePower({_p},{_bookab}) is true:
if {_bookab} is "enhanced_sharpness":
setCooldown({_p}, 90, 12)
broadcast "%{bookcd::%{_uuid}%}% : this is cooldown part 2!"
play sound "block.beacon.power_select" at volume 0.30 at pitch 1.50 at location of {_p}
set attack damage attribute of {_p} to attack damage attribute of {_p} + 0.5
wait 12 seconds
set attack damage attribute of {_p} to 1
else:
if getActionBarCooldown({_p}) contains "!":
message "&cYour book ability is on cooldown for %getActionBarCooldown({_p})%" to {_p}
else:
message "&cYour book ability is on cooldown for %getActionBarCooldown({_p})%!" to {_p}