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
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示