@ascentbv/ts-common - v1.0.123
    Preparing search index...

    Class LocationUtilAbstract

    Index

    Constructors

    Properties

    LEAVES_DATA: Set<string> = ...

    List of all Minecraft leaf block identifiers, used to bypass during certain raycasts.

    Methods

    • Attempts to find a random spawn location near a random player. Prioritizes valid and safe locations and falls back to a highest point check if needed.

      Returns { spawnLocation: Vec3; dimension: Dimension } | undefined

      An object with a valid spawn location and its dimension.

    • Gets the highest solid block Y-coordinate at a given X/Z location. Can optionally include liquid/passable blocks and bypass leaves.

      Parameters

      • dimension: Dimension

        The dimension to check in.

      • location: Vec3

        The center location (X/Z).

      • includeLiquid: boolean = false

        If true, include liquid blocks in raycast.

      • includePassable: boolean = false

        If true, include passable blocks like grass.

      • bypassLeaves: boolean = false

        If true, skips leaf blocks and continues downward.

      • useExactLocation: boolean = true

        If false, uses raycast hit location instead of given location.

      • fromHeight: number = 320

        Start height for raycast (default 320).

      Returns Vec3

      Vec3 with the highest block location above the given point.

    • Determines if an entity is underground by raycasting upwards from head height. Returns true if the ray hits a block, indicating overhead coverage. Also skips leaves unless a non-leaf block is above them.

      Parameters

      • entity: Entity

        The entity to check.

      • maxHeight: number = 320

        How far up to check (default 320).

      Returns boolean

      True if the entity is under a solid block.