Allows this entity to generate paths by walking around and jumping up and down a block like regular mobs.

Example

navigationWalk.js

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

const blaze = world
.getDimension("overworld")
.spawnEntity("minecraft:blaze", { x: 0, y: 0, z: 0 });
const navigationGeneric = blaze.getComponent("minecraft:navigation.walk");
console.warn(
"blaze - avoidDamageBlocks: " + navigationGeneric.avoidDamageBlocks
);
console.warn("blaze - avoidPortals: " + navigationGeneric.avoidPortals);
console.warn("blaze - avoidSun: " + navigationGeneric.avoidSun);
console.warn("blaze - avoidWater: " + navigationGeneric.avoidWater);
console.warn("blaze - canBreach: " + navigationGeneric.canBreach);
console.warn("blaze - canBreakDoors: " + navigationGeneric.canBreakDoors);
console.warn("blaze - canFloat: " + navigationGeneric.canFloat);
console.warn("blaze - canJump: " + navigationGeneric.canJump);
console.warn("blaze - canOpenDoors: " + navigationGeneric.canOpenDoors);
console.warn("blaze - canOpenIronDoors: " + navigationGeneric.canOpenIronDoors);
console.warn("blaze - canPassDoors: " + navigationGeneric.canPassDoors);
console.warn("blaze - canPathFromAir: " + navigationGeneric.canPathFromAir);
console.warn("blaze - canPathOverLava: " + navigationGeneric.canPathOverLava);
console.warn("blaze - canPathOverWater: " + navigationGeneric.canPathOverWater);
console.warn("blaze - canSink: " + navigationGeneric.canSink);
console.warn("blaze - canSwim: " + navigationGeneric.canSwim);
console.warn("blaze - canWalk: " + navigationGeneric.canWalk);
console.warn("blaze - canWalkInLava: " + navigationGeneric.canWalkInLava);
console.warn("blaze - isAmphibious: " + navigationGeneric.isAmphibious);
console.warn("blaze - isValid: " + navigationGeneric.isValid());

Hierarchy

Constructors

Properties

avoidDamageBlocks: boolean

Remarks

Tells the pathfinder to avoid blocks that cause damage when finding a path.

Throws

This property can throw when used.

avoidPortals: boolean

Remarks

Tells the pathfinder to avoid portals (like nether portals) when finding a path.

Throws

This property can throw when used.

avoidSun: boolean

Remarks

Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths.

Throws

This property can throw when used.

avoidWater: boolean

Remarks

Tells the pathfinder to avoid water when creating a path.

Throws

This property can throw when used.

canBreach: boolean

Remarks

Tells the pathfinder whether or not it can jump out of water (like a dolphin).

Throws

This property can throw when used.

canBreakDoors: boolean

Remarks

Tells the pathfinder that it can path through a closed door and break it.

Throws

This property can throw when used.

canFloat: boolean

Remarks

Tells the pathfinder whether or not it can float.

Throws

This property can throw when used.

canJump: boolean

Remarks

Tells the pathfinder whether or not it can jump up blocks.

Throws

This property can throw when used.

canOpenDoors: boolean

Remarks

Tells the pathfinder that it can path through a closed door assuming the AI will open the door.

Throws

This property can throw when used.

canOpenIronDoors: boolean

Remarks

Tells the pathfinder that it can path through a closed iron door assuming the AI will open the door.

Throws

This property can throw when used.

canPassDoors: boolean

Remarks

Whether a path can be created through a door.

Throws

This property can throw when used.

canPathFromAir: boolean

Remarks

Tells the pathfinder that it can start pathing when in the air.

Throws

This property can throw when used.

canPathOverLava: boolean

Remarks

Tells the pathfinder whether or not it can travel on the surface of the lava.

Throws

This property can throw when used.

canPathOverWater: boolean

Remarks

Tells the pathfinder whether or not it can travel on the surface of the water.

Throws

This property can throw when used.

canSink: boolean

Remarks

Tells the pathfinder whether or not it will be pulled down by gravity while in water.

Throws

This property can throw when used.

canSwim: boolean

Remarks

Tells the pathfinder whether or not it can path anywhere through water and plays swimming animation along that path.

Throws

This property can throw when used.

canWalk: boolean

Remarks

Tells the pathfinder whether or not it can walk on the ground outside water.

Throws

This property can throw when used.

canWalkInLava: boolean

Remarks

Tells the pathfinder whether or not it can travel in lava like walking on ground.

Throws

This property can throw when used.

entity: Entity

Remarks

The entity that owns this component. The entity will be undefined if it has been removed.

isAmphibious: boolean

Remarks

Tells the pathfinder whether or not it can walk on the ground or go underwater.

Throws

This property can throw when used.

typeId: string

Remarks

Identifier of the component.

componentId: "minecraft:navigation.walk" = 'minecraft:navigation.walk'

Methods

  • Returns boolean

    Whether the component is valid.

    Remarks

    Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.