Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Extends
When present on an item, this item has a cooldown effect when used by entities.
Properties
cooldownCategory
read-only cooldownCategory: string;
Represents the cooldown category that this item is associated with.
Type: string
Notes:
- This property can throw errors when used.
cooldownTicks
read-only cooldownTicks: number;
Amount of time, in ticks, it will take this item to cooldown.
Type: number
Notes:
- This property can throw errors when used.
Methods
getCooldownTicksRemaining
getCooldownTicksRemaining(player: Player): number
Parameters
- player: Player
Returns number
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
isCooldownCategory
isCooldownCategory(cooldownCategory: string): boolean
Will return true if the item is the cooldown category passed in and false otherwise.
Parameters
cooldownCategory: string
The cooldown category that might be associated with this item.
Returns boolean - True if the item is the given cooldown category.
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
startCooldown
startCooldown(player: Player): void
Starts a new cooldown period for this item.
Parameters
- player: Player
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
Constants
componentId
static read-only componentId = "minecraft:cooldown";
Type: string