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

    Class EntityAgeableComponent

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

    const pig = world.getDimension("nether").spawnEntity("minecraft:pig", { x: 0, y: 0, z: 0 });
    const ageable = pig.getComponent("ageable");
    const growUpEvent = ageable.growUp.eventName;
    world.sendMessage(`Pig ageable duration: ${ageable.duration}`);
    world.sendMessage(`Pig grow up event: ${growUpEvent}`);
    world.sendMessage(`Pig drop items: ${ageable.getDropItems()}`);
    world.sendMessage(`Pig feed items: ${ageable.getFeedItems()}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    duration: number

    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.

    growUp: Trigger

    This property can throw errors.

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

    isValid: boolean
    transformToItem: string

    This property can throw errors.

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

    typeId: string

    Methods

    • Returns string[]

      This function can't be called in read-only mode.

      This function can throw errors.

      This function can't be called in early-execution mode.