Script API - v1.26.10.23
    Preparing search index...

    Class EntityBreathableComponent

    import { world } from "@minecraft/server";

    const pig = world.getDimension("overworld").getEntities({ type: "minecraft:pig" })[0];
    const breathable = pig.getComponent("breathable");
    if (breathable) {
    breathable.breathesAir;
    breathable.breathesLava;
    breathable.breathesSolids;
    breathable.breathesWater;
    breathable.generatesBubbles;
    breathable.inhaleTime;
    breathable.suffocateTime;
    breathable.totalSupply;
    breathable.getBreatheBlocks();
    breathable.getNonBreatheBlocks();
    breathable.airSupply = 100; // Assuming 100 as an example value
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    breathesAir: boolean

    This property can throw errors.

    This property can't be read in early-execution mode.

    breathesLava: boolean

    This property can throw errors.

    This property can't be read in early-execution mode.

    breathesSolids: boolean

    This property can throw errors.

    This property can't be read in early-execution mode.

    breathesWater: boolean

    This property can throw errors.

    This property can't be read in early-execution mode.

    entity: Entity

    This property can throw errors.

    InvalidEntityError

    This property can't be read in early-execution mode.

    generatesBubbles: boolean

    This property can throw errors.

    This property can't be read in early-execution mode.

    inhaleTime: number

    This property can throw errors.

    This property can't be read in early-execution mode.

    isValid: boolean
    suffocateTime: number

    This property can throw errors.

    This property can't be read in early-execution mode.

    totalSupply: number

    This property can throw errors.

    This property can't be read in early-execution mode.

    typeId: string

    Methods