command test:
permission: op
trigger:
give {item::CritPick} to player
on right click:
1 of player's held item = item("critpick")
set metadata value "cooldown" of player to metadata value "cooldown" of player ? now
difference between metadata value "cooldown" of player and now > 60 seconds:
if "%item cooldown of player's tool for player%" is "0 seconds":
set item cooldown of player's tool for player to 60 seconds
set metadata value "cooldown" of player to now
apply haste 5 without particles whilst hiding icon to player for 15 seconds replacing existing effect
on player's held item change:
apply haste 1 without particles whilst hiding icon to player for 1 seconds replacing existing effect
else:
send action bar "&bwait %seconds of 60 seconds - difference between metadata value "cooldown" of player and now% seconds before you can use this again" to player
permission: op
trigger:
give {item::CritPick} to player
on right click:
1 of player's held item = item("critpick")
set metadata value "cooldown" of player to metadata value "cooldown" of player ? now
difference between metadata value "cooldown" of player and now > 60 seconds:
if "%item cooldown of player's tool for player%" is "0 seconds":
set item cooldown of player's tool for player to 60 seconds
set metadata value "cooldown" of player to now
apply haste 5 without particles whilst hiding icon to player for 15 seconds replacing existing effect
on player's held item change:
apply haste 1 without particles whilst hiding icon to player for 1 seconds replacing existing effect
else:
send action bar "&bwait %seconds of 60 seconds - difference between metadata value "cooldown" of player and now% seconds before you can use this again" to player