Interface Entity

Wrapper for Minecraft's Entity class

Hierarchy

  • Entity

Properties

echest: Inventory

Player's ender chest inventory, or null if entity is not a player

inventory: Inventory

Entity's inventory, or null if none found

Methods

  • add_effect(effect: string, duration: number, amplifier: number, hide_particles: boolean): void
  • Applies an effect to the entity

    Parameters

    • effect: string

      Effect

    • duration: number

      Duration in seconds

    • amplifier: number

      Amplifier

    • hide_particles: boolean

      Hides effect particles

    Returns void

  • clear_effects(): void
  • Clears all effects

    Remarks

    It calls /effect clear

    Returns void

  • get_age(): null | number
  • Gets an entity's age in ticks

    Remarks

    Entity must be living

    See

    is_living_entity

    Returns null | number

  • get_air(): number
  • Get remaining air

    Returns number

  • get_armor(): null | number
  • Gets the entity's armor level

    Remarks

    Entity must be living

    See

    is_living_entity

    Returns null | number

  • get_hp(): null | number
  • Gets the current health of the entity

    Remarks

    Entity must be living

    See

    is_living_entity

    Returns null | number

  • get_name(): string
  • Gets the entity's name

    Returns string

  • Gets an nbt object from the entity

    Remarks

    path cannot include subpaths, as /data get has. This may change eventually

    Parameters

    • path: string

      NBT key

    Returns NbtElement

  • Get position of an entity

    Returns Vec3d

  • is_living_entity(): boolean
  • Is the entity living (i.e. has health)

    Returns boolean

  • Merges a table with the entity's nbt data

    Parameters

    Returns void

  • set_age(age: number): void
  • Sets an entity's age in ticks

    Remarks

    Entity must be living

    See

    is_living_entity

    Parameters

    • age: number

      Age

    Returns void

  • set_air(air: number): void
  • Set remaining air

    Parameters

    • air: number

      New air

    Returns void

  • set_hp(amount: number): void
  • Sets the health of the entity

    Remarks

    Entity must be living

    See

    is_living_entity

    Parameters

    • amount: number

      Amount

    Returns void

  • set_pos(pos: Vec3d): void
  • Set the position of an entity

    Remarks

    Uses /tp to set position

    Parameters

    Returns void

Generated using TypeDoc