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

    Class PlayerUtilAbstract

    Index

    Constructors

    Methods

    • Gets the floored location of a player, adjusted to account for their swimming state. If the player is swimming, it returns the current Y; otherwise, it adds +1 to center on their body.

      Parameters

      • player: Player

        The player to get the location of.

      Returns { x: number; y: number; z: number } | null

      The adjusted and floored player position, or null if an error occurs.

    • Gets the player's facing direction (yaw), snapped to the nearest cardinal direction in 90° increments (North, East, South, West).

      Parameters

      • player: Player

        The player whose yaw to retrieve.

      Returns number | null

      The snapped yaw in degrees, constrained to [-180, 180].

    • Computes the player's forward look vector, but forces a minimum downward angle of 20°.

      Parameters

      • player: Player

        The player whose look vector to compute. *

      Returns Vec3 | null

      A unit Vec3 representing the forward direction, or null if something fails.