ItemCooldownComponent Class
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
Warning
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
Warning
This property can throw errors when used.
Methods
getCooldownTicksRemaining
getCooldownTicksRemaining(player: Player): number
Parameters
- player: Player
Returns number
Important
This function can't be called in read-only mode.
Warning
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.
Important
This function can't be called in read-only mode.
Warning
This function can throw errors.
startCooldown
startCooldown(player: Player): void
Starts a new cooldown period for this item.
Parameters
- player: Player
Important
This function can't be called in read-only mode.
Warning
This function can throw errors.
Constants
componentId
static read-only componentId = "minecraft:cooldown";
Type: string
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for