Entity class that allows movement

Hierarchy

Implements

Constructors

Properties

Accessors

Methods

Constructors

Properties

_description?: ITileEventDescription
allowSmartMovementClientside?: boolean

Used for smart vehicle movement (minecarts) Note: This is clientside only.

anim: number = 0
attackAnimationData?: IAttackAnimationData

Used for attack animations. Note: This is clientside only.

builderIdentifier?: string
decay?: number
direction?: default

undefined = Vector2.ZERO for this

event: IEventEmitter<default, ITileEventEvents>
facingDirection?: East | North | West | South

undefined = Direction.None for this

fromX: number = 0

Note: This might not be a whole number.

fromY: number = 0

Note: This might not be a whole number.

fuel?: number

For use with the Fire TileEvent to check if it has a fuel source and should create ash by default. Set to 0 to stop all ash production.

gfx?: number
historicalActions?: PartialRecord<ActionType, number>
id: number
isMoving?: boolean

Not guaranteed to be synced between the server and client for Human entities

islandId: `${number},${number}`
maxDur?: number
minDur?: number
moveType?: MoveType
movementCompleteZ?: number

Only used for Human entities

movingData: IMovingData = {}

Used for movement animations. Note: This is clientside only.

persistentMarker: undefined | {
    guid: string;
    type: Tamed;
}

Notifier marker assigned to this entity

preventRendering?: boolean
referenceId?: number

Do not use this property directly, instead use `game.references.getReference()

renamed?: string | ISerializedTranslation
shouldSkipNextMovement?: true
shouldSkipNextUpdate?: true
slipping?: ISlippingData
spread?: number
step?: number
x: number
y: number
z: WorldZ

Accessors

  • get asContainer(): undefined
  • Returns undefined

  • get asCorpse(): undefined
  • Returns undefined

  • get asCreature(): undefined
  • Returns undefined

  • get asDoodad(): undefined
  • Returns undefined

  • get asEntity(): default<DescriptionType, TypeType, EntityReferenceType, TagType>
  • Returns default<DescriptionType, TypeType, EntityReferenceType, TagType>

  • get asEntityMovable(): default<DescriptionType, TypeType, EntityReferenceType, TagType>
  • Returns default<DescriptionType, TypeType, EntityReferenceType, TagType>

  • get asEntityWithStats(): undefined | default<DescriptionType, TypeType, EntityReferenceType, TagType>
  • Returns undefined | default<DescriptionType, TypeType, EntityReferenceType, TagType>

  • get asHuman(): undefined
  • Returns undefined

  • get asItem(): undefined
  • Returns undefined

  • get asLoaded(): undefined | this
  • undefined if this entity's island is not loaded, this if it is

    Returns undefined | this

  • get asLocalPlayer(): undefined
  • Returns undefined

  • get asNPC(): undefined
  • Returns undefined

  • get asNotLocalPlayer(): undefined | this
  • Returns undefined | this

  • get asPlayer(): undefined
  • Returns undefined

  • get asTile(): undefined
  • Returns undefined

  • get asTileEvent(): undefined | default
  • Returns undefined | default

  • get description(): undefined | Readonly<DescriptionType>
  • Get the entities description

    Returns undefined | Readonly<DescriptionType>

  • get entityType(): TileEvent
  • Returns TileEvent

  • get facingTile(): default
  • Regular entities don't have a direction so this will be the same as getTile()

    Returns default

  • get fromTile(): undefined | default
  • Tile the entity is moving from

    Returns undefined | default

  • get humansVisible(): default<unknown, number, NPC | Player>[]
  • Returns humans within this entities fov & that they can see

    Returns default<unknown, number, NPC | Player>[]

  • get isFlying(): boolean
  • Returns boolean

  • get isLoaded(): boolean
  • Whether this entity's island is loaded

    Returns boolean

  • get isLocalPlayer(): boolean
  • Returns boolean

  • get isOnFire(): FireType
  • Returns FireType

  • get isValid(): boolean
  • Returns boolean

  • get isWithinHumanBounds(): boolean
  • Checks if the entity is within the viewport bounds of one or more humans

    Returns boolean

  • get island(): default
  • Returns default

  • get point(): IVector3
  • Location of the entity on the world. Parent classes will probably mark this as always defined

    Returns IVector3

  • get reference(): undefined | Reference<EntityReferenceType>
  • Returns undefined | Reference<EntityReferenceType>

  • get slippingData(): undefined | ISlippingData
  • Returns undefined | ISlippingData

  • get tile(): default
  • Tile the entity is on in the world. Parent classes will probably mark this as always defined

    Returns default

  • get tileUpdateType(): TileUpdateType
  • Returns TileUpdateType

  • get tilesAround(): undefined | default[]
  • Returns undefined | default[]

Methods

  • Parameters

    Returns void

  • Adds a referenceId to the entity if it doesn't already have one

    Returns void

  • Parameters

    • tag: unknown

    Returns void

  • Parameters

    Returns void

  • Animates the entity between a specific set of positions

    Parameters

    • fromX: number
    • fromY: number
    • toX: number
    • toY: number
    • delay: Delay

    Returns void

  • Parameters

    Returns void

  • Faces the target and animates a bump into effect

    Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    • type: CanASeeBType
    • islandId: `${number},${number}`
    • x: number
    • y: number
    • z: number
    • fieldOfView: undefined | FieldOfView = renderer.fieldOfView
    • Optional customRadius: number

    Returns boolean

  • Returns void

  • Gets the builder/creator of this event, or undefined if the tile event is creatorless.

    Returns undefined | default

  • Gets a data

    Returns

    Data value or undefined if it wasn't found

    Type Parameters

    • T

    Parameters

    • key: string

      Data key

    Returns undefined | T

  • Returns number

  • Gets movement progress and moves the state machine forward when the movement is completed

    Parameters

    • timeStamp: number

    Returns number

  • Gets the temperature produced by this object. Positive values are "heat", negative values are "cold". Refer to the values of the Temperature enum to see the possible range. If this method is not implemented, or it returns undefined, Temperature.Neutral is used.

    Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Check if a data was set

    Returns

    True if the data exists, false if it doesn't

    Parameters

    • key: string

      Data key

    Returns boolean

  • Parameters

    • tag: unknown

    Returns boolean

  • Parameters

    • type: SfxType
    • Optional delay: number
    • Optional speed: number

    Returns void

  • Parameters

    • type: SfxType
    • Optional delay: number
    • Optional speed: number

    Returns void

  • Removes a data

    Returns

    True when the data is removed. False if the key wasn't set

    Parameters

    • key: string

      Data key

    Returns boolean

  • Parameters

    • updateTile: boolean

    Returns void

  • Returns void

  • Parameters

    • tag: unknown

    Returns void

  • Sets a data

    Rturns

    The value

    Type Parameters

    • T

    Parameters

    • key: string

      Data key

    • value: T

      Data value

    Returns T

  • Parameters

    • fromX: number = ...
    • fromY: number = ...

    Returns void

  • Parameters

    • fromX: number
    • fromY: number
    • Optional toZ: number
    • Optional options: IMoveToOptions

    Returns void

  • Immediately move the entity to the tile

    Parameters

    Returns void

  • Skips the next movement for this creature / npc

    Returns void

  • Skips the next update for this creature / npc

    Returns void

  • Returns void

  • Returns string

  • Parameters

    Returns void

  • Called when the entity is about to move to another tile. This should update relevant properties on the tile and return true

    Returns

    False to block the move

    Parameters

    • fromTile: default

      Tile the entity was on

    • toTile: default

      Tile the entity is moving onto

    Returns boolean

  • Updates the world renderer & flow field state for the tile

    Parameters

    • tileUpdateType: TileUpdateType = ...
    • Optional updateNeighbors: boolean
    • Optional skipFlowFieldUpdate: boolean

    Returns void

  • Parameters

    • value: any

    Returns value is default

Generated using TypeDoc