A class representing an in-game entity.

Hierarchy

Constructors

Properties

runtimeId: number

The runtime ID of the entity. Local player is always 1.

Methods

  • Makes your player attack the entity. Only works if you have operator

    This function is restricted - meaning it will only work on LocalPlayer or if you have OP

    Returns void

    Throws

  • Get the dimension name. for example, "Overworld"

    Returns string

  • Gets the health of the entity.

    This function is restricted - meaning it will only work on LocalPlayer or if you have OP

    Returns number

  • Gets the hunger of the entity.

    This function is restricted - meaning it will only work on LocalPlayer or if you have OP

    Returns number

  • Gets the number of ticks that the entity is invulnerable (after the entity is hit/hurt), ranges from 0-10

    Returns number

  • Get the interpolated position. Use this in the context of rendering based on entity position.

    Returns Vector3

  • Gets the saturation of the entity.

    This function is restricted - meaning it will only work on LocalPlayer or if you have OP

    Returns number

  • Whether the entity is the local player (yourself) or not.

    Returns boolean

  • Whether the entity is a player or not.

    Returns boolean

  • Check if the entity is still valid. In some cases, Latite may invalidate an entity outside of an event listener. This is to prevent the scripting engine from being used as a cheat.

    Returns boolean

  • [Experimental] sets a MoLang variable's value. Returns null if unsuccessful and the number that was set if it was successful.

    Parameters

    • name: string

      The variable name. Example: variable.is_sneaking

    • value: number

      The variable's new value.

    Returns null | number

Generated using TypeDoc