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

    EntityInventoryComponent

    Class in @minecraft/server

    Extends EntityComponent

    A player’s inventory.

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

    read-only

    readonly typeId: "minecraft:inventory";

    read-only

    readonly container: Container;

    read-only

    readonly inventorySize: number;

    EntityComponentTypeMap.minecraft:inventory, EntityComponentTypeMap.inventory