Перейти к основному содержанию

AddonEntityRegistry

Module used to manage custom entities added via add-ons.

@since

2.0.1b18

@remarks

Depends on local player dimension, highly recommended to replace it with BlockSource.spawnEntity and Entity.getTypeName.

Index

Interfaces

AddonEntity

AddonEntity:

readonlyid

id: number

Entity unique ID.

readonlytype

type: string

Add-on defined entity name ID.

exec

  • exec(command: string): string
  • Executes command with the entity.


    Parameters

    • command: string

      command to be executed

    Returns string

    Error message or null if the command was run successfully.

execAt

  • execAt(command: string, x: number, y: number, z: number): string
  • Executes command with the entity on the specified coordinates.


    Parameters

    • command: string

      command to be executed

    • x: number
    • y: number
    • z: number

    Returns string

    Error message or null if the command was run successfully.

Functions

getEntityData

  • Added entities stores in registry, so already spawned entity data may resolved again by requesting information by UID.


    Parameters

    • entity: number

    Returns AddonEntity

    Add-on entity information by entity ID.

spawn

  • spawn(x: number, y: number, z: number, nameID: string): number
  • Spawns an entity defined via add-on on the specified coordinates.

    @deprecated

    Client-side method, use BlockSource.spawnEntity instead.


    Parameters

    • x: number
    • y: number
    • z: number
    • nameID: string

      entity name ID, as defined from add-on

    Returns number

Page Options