JSPrismarine
    Preparing search index...

    Class EntityLikeInternal

    Entity-like class.

    Hierarchy (View Summary)

    Index

    Constructors

    • EntityLike constructor.

      Parameters

      • options: {
            headYaw?: number;
            pitch?: number;
            runtimeId: bigint;
            server: Server;
            uuid?: string;
            world: World;
            yaw?: number;
        }

        The entity-like options.

        • OptionalheadYaw?: number

          The head yaw.

        • Optionalpitch?: number

          The pitch.

        • runtimeId: bigint

          The entity's runtime id.

        • server: Server

          The server instance.

        • Optionaluuid?: string

          The entity's runtime id.

        • world: World

          The world the entity belongs to.

        • Optionalyaw?: number

          The yaw.

      Returns EntityLike

      The entity-like instance.

    Properties

    headYaw: number
    pitch: number
    runtimeId: bigint
    server: Server
    uuid: string
    x: number = 0

    The X coordinate.

    y: number

    The Y coordinate.

    yaw: number
    z: number = 0

    The Z coordinate.

    Accessors

    Methods

    • Returns the nearest entity from the current entity.

      Parameters

      • Optionalentities: Entity[] = ...

        The entities to compare the distance between.

      Returns Entity[]

      The nearest entity.

      Customizable radius

      const nearestEntity = entity.getNearestEntity();
      console.log('Nearest entity:', nearestEntity);
    • Creates a new Vector3 instance from an object with x, y, and z properties.

      Parameters

      • obj: { x: number; y: number; z: number }

        The object containing x, y, and z properties.

      Returns Vector3

      A new Vector3 instance.