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

    Class EntityNavigationHoverComponent

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

    // This example demonstrates how to work with EntityNavigationHoverComponent
    // This component is used by entities that can hover/fly like bees and ghasts

    system.run(() => {
    const overworld = world.getDimension("overworld");

    // Spawn a bee (which uses hover navigation for flying)
    const bee = overworld.spawnEntity("minecraft:bee", { x: 0, y: 64, z: 0 });

    // Get the navigation.hover component
    const navigationHover = bee.getComponent("minecraft:navigation.hover");

    if (navigationHover) {
    console.log("=== Bee Hover Navigation Properties ===");

    // Check flight and hovering capabilities
    console.log(`Can path from air: ${navigationHover.canPathFromAir}`);
    console.log(`Can float: ${navigationHover.canFloat}`);
    console.log(`Can jump: ${navigationHover.canJump}`);
    console.log(`Can swim: ${navigationHover.canSwim}`);
    console.log(`Can walk: ${navigationHover.canWalk}`);

    // Check pathfinding over different surfaces
    console.log(`Can path over water: ${navigationHover.canPathOverWater}`);
    console.log(`Can path over lava: ${navigationHover.canPathOverLava}`);

    // Check avoidance behaviors (important for flying entities)
    console.log(`Avoids water: ${navigationHover.avoidWater}`);
    console.log(`Avoids sun: ${navigationHover.avoidSun}`);
    console.log(`Avoids damage blocks: ${navigationHover.avoidDamageBlocks}`);
    console.log(`Avoids portals: ${navigationHover.avoidPortals}`);

    // Check door interaction (usually false for flying entities)
    console.log(`Can open doors: ${navigationHover.canOpenDoors}`);
    console.log(`Can break doors: ${navigationHover.canBreakDoors}`);
    console.log(`Can pass doors: ${navigationHover.canPassDoors}`);
    console.log(`Can open iron doors: ${navigationHover.canOpenIronDoors}`);

    // Check special abilities
    console.log(`Is amphibious: ${navigationHover.isAmphibious}`);
    console.log(`Can breach: ${navigationHover.canBreach}`);
    console.log(`Can sink: ${navigationHover.canSink}`);
    console.log(`Can walk in lava: ${navigationHover.canWalkInLava}`);

    console.log(`Component is valid: ${navigationHover.isValid}`);

    // Send a summary message to the world
    world.sendMessage(`Bee spawned with hover navigation! It can fly around freely.`);

    // Fun fact: Display what makes hover navigation special
    if (navigationHover.canPathFromAir) {
    console.log("🐝 This bee can navigate through the air without needing solid ground!");
    }
    } else {
    console.log("Failed to get navigation.hover component from bee");
    world.sendMessage("Could not access bee hover navigation component");
    }
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    avoidDamageBlocks: boolean

    This property can throw errors.

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

    avoidPortals: boolean

    This property can throw errors.

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

    avoidSun: boolean

    This property can throw errors.

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

    avoidWater: boolean

    This property can throw errors.

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

    canBreach: boolean

    This property can throw errors.

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

    canBreakDoors: boolean

    This property can throw errors.

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

    canFloat: boolean

    This property can throw errors.

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

    canJump: boolean

    This property can throw errors.

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

    canOpenDoors: boolean

    This property can throw errors.

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

    canOpenIronDoors: boolean

    This property can throw errors.

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

    canPassDoors: boolean

    This property can throw errors.

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

    canPathFromAir: boolean

    This property can throw errors.

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

    canPathOverLava: boolean

    This property can throw errors.

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

    canPathOverWater: boolean

    This property can throw errors.

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

    canSink: boolean

    This property can throw errors.

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

    canSwim: boolean

    This property can throw errors.

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

    canWalk: boolean

    This property can throw errors.

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

    canWalkInLava: 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.

    isAmphibious: boolean

    This property can throw errors.

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

    isValid: boolean
    typeId: string