Home Commands Examples Getting Started With Scripts Global Keywords

ItemCooldowns

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.item.ItemCooldowns;

Methods

script.zs
ItemCooldowns.addCooldown(item as ItemDefinition, ticks as int)
ParameterType
Parameter
item
Type
ItemDefinition
Parameter
ticks
Type
int

Return Type: float

script.zs
ItemCooldowns.getCooldownPercent(item as ItemDefinition, partialTicks as float) as float
ParameterType
Parameter
item
Type
ItemDefinition
Parameter
partialTicks
Type
float

Return Type: boolean

script.zs
ItemCooldowns.isOnCooldown(item as ItemDefinition) as boolean
ParameterType
Parameter
item
Type
ItemDefinition
script.zs
ItemCooldowns.removeCooldown(item as ItemDefinition)
ParameterType
Parameter
item
Type
ItemDefinition