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

  • 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

  • Gets the item at the current inventory slot. Will return null if the specified slot is out of bounds

    Parameters

    • slot: number

      The slot number

    Returns null | ItemStack

  • Get the player's name (same one as the player list in the pause menu.)

    Returns string

  • Gets the saturation of the entity.

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

    Returns number

  • Gets the slot of the item being held.

    Returns number

  • 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