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

    ItemPotionComponent

    Class in @minecraft/server

    Extends ItemComponent

    The potion a potion, splash potion or lingering potion holds. Read only.

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

    static read-only

    static readonly componentId = "minecraft:potion";

    read-only

    readonly potionDeliveryType: PotionDeliveryType;

    read-only

    readonly potionEffectType: PotionEffectType;

    ItemComponentTypeMap.potion, ItemComponentTypeMap.minecraft:potion

    From ItemComponent: typeId, isValid