Skip to content
BasaltSoftware
Bedrock 1.26.60

Site colour

Discord
Esc

    ↑↓ moveEnter openEsc close

    Keyboard shortcuts
    Ctrl K
    Search the whole site, from any page
    /
    Jump to the sidebar search, or search the whole site where there isn't one
    Enter
    Open the top search result
    Esc
    Clear the search, or close this panel
    ?
    Show these shortcuts

    Class in @minecraft/server

    Extends ItemComponent

    An item’s cooldown: once used, items of its category wait before they can be used again.

    import { ItemCooldownComponent } from '@minecraft/server';
    import { ItemStack, type ItemCooldownComponent } from '@minecraft/server';
    const item = new ItemStack('minecraft:diamond_sword');
    const component: ItemCooldownComponent | undefined = item.getComponent('minecraft:cooldown');
    if (component) {
    console.log(item.typeId, component.cooldownCategory);
    }
    import { ItemStack } from '@minecraft/server';
    const item = new ItemStack('minecraft:diamond_sword');
    const component = item.getComponent('minecraft:cooldown');
    if (component) {
    console.log(item.typeId, component.cooldownCategory);
    }

    static read-only

    static readonly componentId = "minecraft:cooldown";

    read-only

    readonly cooldownCategory: string;

    read-only

    readonly cooldownTicks: number;

    Ticks a use makes the category wait.

    getCooldownTicksRemaining(player: Player): number;

    Ticks the player still waits on this category, 0 for none.

    Parameters
    player
    Player
    Returns
    number
    Types
    isCooldownCategory(cooldownCategory: string): boolean;
    Parameters
    cooldownCategory
    string
    Returns
    boolean
    startCooldown(player: Player): void;

    Starts the cooldown for a player, greying the category’s items out on their screen.

    Parameters
    player
    Player
    Types

    ItemComponentTypeMap.cooldown, ItemComponentTypeMap.minecraft:cooldown

    From ItemComponent: typeId, isValid