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
    Entity components

    EntityEquippableComponent

    What a player or mob wears and holds: armour, the main hand (a player's held slot), the offhand, and a mob's body.

    Class in @minecraft/server

    Extends EntityComponent

    What a player or mob wears and holds: armour, the main hand (a player’s held slot), the offhand, and a mob’s body.

    import { EntityEquippableComponent } from '@minecraft/server';
    import { world, type EntityEquippableComponent } from '@minecraft/server';
    for (const player of world.getAllPlayers()) {
    const component: EntityEquippableComponent | undefined = player.getComponent('minecraft:equippable');
    if (component) {
    console.log(player.name, component.typeId);
    }
    }
    import { world } from '@minecraft/server';
    for (const player of world.getAllPlayers()) {
    const component = player.getComponent('minecraft:equippable');
    if (component) {
    console.log(player.name, component.typeId);
    }
    }

    read-only

    readonly typeId: "minecraft:equippable";

    read-only

    readonly entity: Entity;
    Types

    read-only

    readonly isValid: boolean;
    getEquipment(equipmentSlot: EquipmentSlot): ItemStack | undefined;

    The item in a slot, or undefined if it’s empty.

    Parameters
    equipmentSlot
    EquipmentSlot
    Returns
    ItemStack | undefined
    getEquipmentSlot(equipmentSlot: EquipmentSlot): ContainerSlot;

    A live handle on a slot, for reading or changing the item in it as it changes, rather than a one-off copy. The same slots getEquipment and setEquipment reach.

    Parameters
    equipmentSlot
    EquipmentSlot
    Returns
    ContainerSlot
    setEquipment(equipmentSlot: EquipmentSlot, itemStack?: ItemStack): boolean;

    Puts an item in a slot, or empties it with no item. Those who see a mob are shown it at once, and the mob keeps it when saved (its body slot excepted).

    Parameters
    equipmentSlot
    EquipmentSlot
    itemStackoptional
    ItemStack
    Returns
    booleanTrue: the change is sent.

    EntityComponentTypeMap.minecraft:equippable, EntityComponentTypeMap.equippable