Entity class that allows movement

Hierarchy

Implements

Constructors

Properties

Accessors

Methods

addMarkerIcon addReferenceId addTag addTreasureChestLoot animate animateAttack animateBumpTowards animateSkeletalRemains asNot asType attachStillContainer canCauseStatus canGather canGrow canHarvest canInspect canPickUp canSeeObject canSeePosition canSeeTile canSwapWith canTrample changeCivilizationScore changeType checkForTrampling clearTileCache damage detachStillContainer displayItem dryDockBoat getActions getAssociatedItem getBookcaseFullness getBuilder getCivilizationScore getCrafter getCrafterOrLocalPlayer getDamage getData getDefaultDurability getDescription getDisplayDoodad getGrowthParticles getInsulation getItemUseBonus getLiquidGatherType getMagicalDoodadSkills getMeltRate getMoveType getMovementDelay getMovementPoint getMovementProgress getName getPickUpTypes getProducedTemperature getRegistrarId getTargetContainer getTileId getTrapDamageBonus getVehicle getWanderChance? getWanderHomePoint? getWanderHomeRadius? getWanderIdleChance? getWanderNewDirectionChance? getcontainedItemSkillBonuses hasData hasTag healOrHarmPlant increaseFertility initializeMagicalPropertyManager isContainer isCorpse isCreature isDangerous isDoodad isEmbers isEntity isGatherable isHuman isInGroup isIslandPort isItem isLitAndCanRevert isNPC isNearby isPlayer isTall isTile isTileEvent isVehicleAllowedOnTile moveTo notifyItem notifyStat onMovementCompleted onUnserialized overrideNextMovement queueSoundEffect queueSoundEffectInFront refillSolarStill removeData removeMagic removeMarkerIcon removeTag revert setCachedTile setData setFromPosition setGrowingStage setHumansWithinBound setMeltingDecay setMoveType setMoving setName setOffTrap setPosition setQuality setWellStatus skipNextMovement skipNextUpdate startSlipping stopSlipping switchWellStatus toString undisplayAllItems undisplayItem unhitch update updateBookcase updateDirection updateGroupCache updateRender updateSlipping updateTileWhenMoving updateView updateWorldTile getRegistrarId is setRegistrarId

Constructors

Properties

_description?: IDoodadDescription
aberrant?: boolean
addOrder?: number[]
allowSmartMovementClientside?: boolean

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

anim?: number
attackAnimationData?: IAttackAnimationData

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

bonusAttack?: number
builderIdentifier?: string
connectedEntityReference?: Reference<NPC | Player>
containedItems?: default[]
crafterIdentifier?: string
decay?: number
direction?: default

undefined = Vector2.ZERO for this

disassembly?: default[]
equipped?: Map<EquipType, default>
event: IEventEmitter<default, IDoodadEvents>
facingDirection?: East | North | West | South

undefined = Direction.None for this

fromX?: number

Note: This might not be a whole number.

fromY?: number

Note: This might not be a whole number.

gatherReady?: number
growth?: GrowingStage
hasWater?: IHasWater
historicalActions?: PartialRecord<ActionType, number>
hitchedCreature?: number
id: number
isMoving?: boolean

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

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

Only used for Human entities

movingData: IMovingData = {}

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

orientation?: DoorOrientation
persistentMarker: undefined | {
    guid: string;
    type: Tamed;
}

Notifier marker assigned to this entity

preventRendering?: boolean
protected?: boolean

Used to store protection status for built doodads

quality?: Quality
referenceId?: number

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

renamed?: string | ISerializedTranslation
shouldSkipNextMovement?: true
shouldSkipNextUpdate?: true
slipping?: ISlippingData
sortDirection?: SortDirection
spread?: number
stacks?: Set<ItemType>
startingDecay?: number
step?: number
stillContainer?: default
tradedFrom?: string[]
weight?: number
x: number
y: number
z: WorldZ
registrarId: number

Accessors

  • get asContainer(): undefined | this & IContainer
  • Returns undefined | this & IContainer

  • get asCorpse(): undefined
  • Returns undefined

  • get asCreature(): undefined
  • Returns undefined

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

  • 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
  • Returns undefined

  • get blocksMove(): boolean
  • Returns boolean

  • get connectedEntity(): undefined | default<unknown, number, NPC | Player>
  • Entity controlling this doodad (for wheel barrows)

    Returns undefined | default<unknown, number, NPC | Player>

  • get constructorFunction(): typeof default
  • Returns typeof default

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

    Returns undefined | Readonly<DescriptionType>

  • get durability(): number
  • Returns number

  • set durability(value: number): void
  • Parameters

    • value: number

    Returns void

  • get durabilityMax(): number
  • Returns number

  • set durabilityMax(value: number): void
  • Parameters

    • value: number

    Returns void

  • get durabilityMaxWithMagical(): number
  • Returns number

  • get entityType(): Doodad
  • Returns Doodad

  • 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 isVehicle(): 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

  • 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

  • Potentially animates a skeleton (if it can spawn) and returns a message to all those who can see it.

    Returns void

  • Parameters

    Returns void

  • Returns boolean

  • Can the doodad be gathered from in its current form?

    Returns boolean

  • Returns boolean

  • Returns boolean

  • Parameters

    Returns boolean

  • Parameters

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

    Returns boolean

  • Returns whether the doodad can be trampled

    Returns undefined | boolean

  • Gives civilization score based on how much is defined for this doodad.

    Parameters

    • add: boolean

    Returns void

  • Parameters

    Returns void

  • Trampling growing things.

    Parameters

    Returns boolean

  • Returns void

  • Parameters

    • forceBreak: boolean = false
    • skipDropAsItem: boolean = false
    • skipSound: boolean = false
    • skipResources: boolean = false
    • damage: number = 1

    Returns void

  • Parameters

    Returns void

  • Forces a boat to be drydocked (revert from doodad to an item if water was taken away for some reason).

    Parameters

    Returns void

  • Returns undefined | ActionType[]

  • Determines which graphic to show based on how full the bookcase is with books/text.

    Returns

    DoodadTypeExtra or DisplayableItemType equal to which graphic it should show.

    Parameters

    • Optional item: boolean

      set to true if DisplayableItemType is to be returned.

    Returns undefined | DoodadTypeExtra | DisplayableItemType

  • Gets the builder of this doodad, or undefined if the doodad is builderless.

    Returns undefined | default

  • Gets civilization score based on doodad's quality and type, but without the magical property values.

    Returns

    number of score (or 0 if no civilization score is set).

    Parameters

    • Optional excludeMagic: boolean

    Returns number

  • Gets the crafter of this doodad, or undefined if the doodad is crafterless.

    Returns undefined | default

  • Gets the crafter of this doodad. If this doodad has no crafter, and this is not a multiplayer server, returns the local player.

    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

  • Parameters

    • random: Random<LegacySeededGenerator | PCGSeededGenerator> = ...

    Returns number

  • Gets if the doodad is set to display any extra graphics/assets.

    Returns

    DisplayableDoodadType or DoodadType (if no extra is set)

    Returns DisplayableDoodadType

  • Returns undefined | IRGB

  • Gets the insulation of this object.

    Insulation is a decimal number from 0 to 1.

    • An insulation of 0 means that the temperature inside this object is equivalent to the temperature outside.
    • An insulation of 1 means that no temperature inside this object is emitted to the outside tiles — it is a completely separate temperature "biome".
    • Values in between change how much of the temperatures are produced/used on either side.

    Parameters

    Returns undefined | number

  • Gets the doodad's quality and action level (how good it is at doing the action) based on the item it is based off of (using repairItem property).

    Returns

    A number (possibly 0 if no quality or action level).

    Parameters

    • action: ActionType

      The ActionType you are trying to get the level for.

    Returns number

  • Returns the type of liquid that can be gathered from this doodad

    Returns undefined | keyof ILiquidGather

  • Gets a set of skill types and values for magical adjacent skill bonuses from doodads.

    Returns

    Map of skill type and number (skill value).

    Returns Map<SkillType, number>

  • Gets the decay rate of a doodad based on the temperature (returns as a default of 0).

    Returns

    The number of melt reduction of the doodad given the temperature of the point.

    Parameters

    Returns number

  • Returns number

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

    Parameters

    • timeStamp: number

    Returns number

  • Parameters

    • Optional article: Article

      Whether to include an article for the name of the doodad. Uses the article rules on the language.. @param count The number of this doodad that you're getting the name of. Defaults to 1`.

      Examples:

      • doodad.getName() // "a stone furnace"
      • doodad.getName(Article.None) // "stone furnace"
      • doodad.getName(Article.None, 3) // "stone furnaces"
    • Optional count: number

    Returns default

  • Returns undefined | ItemType[]

  • 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

  • Returns number

  • Gets the container to use for doodad executed actions

    Returns undefined | IContainer

  • Returns number

  • Return extra trap damage based on player multiplier and magical status

    Parameters

    Returns number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Gets a set of skill types and values from doodads that have "containedItemGroupProvidesSkill" set for items that provide adjacent skill bonuses.

    Returns

    Map of skill type and number (skill value).

    Returns Map<SkillType, 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

  • Increases or decreases plant fertility, growth and durability (health) based on the liquid applied.

    Parameters

    • liquid: LiquidType

      The LiquidType that is to be applied.

    • Optional growthBonus: number

      The bonus that is applied (on top of a default of 10) to the plants decay (so it grows faster).

    Returns void

  • Increased the fertility (spread) of a plant/growing doodad.

    Returns

    True or false depending on if it increased in fertility or not.

    Parameters

    • Optional bypassChange: boolean

      Set to true if you just want to check if fertility can be increased.

    Returns boolean

  • Returns default

  • Returns this is default

  • Returns this is default

  • Parameters

    Returns boolean

  • Returns this is default

  • Returns boolean

  • Can the doodad be gathered from at all?

    Returns boolean

  • Parameters

    Returns boolean

  • Returns boolean

  • Returns this is default

  • Returns boolean

  • Returns this is default

  • Returns this is default

  • Checks if the doodad will be rendered as tall (2 tiles)

    Returns

    True if the doodad is tall

    Returns boolean

  • Returns this is default

  • Returns this is default

  • Parameters

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

    Returns void

  • Parameters

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

    Returns void

  • Refills solar stills when they are on shallow water automatically.

    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

  • Returns void

  • Returns void

  • Reverts lit doodads if they provide fire and have a revert doodad type set.

    Returns boolean

  • 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

    Returns void

  • Initialized the doodad's melting decay number

    Returns void

  • Parameters

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

    Returns void

  • Parameters

    • Optional human: default<unknown, number, NPC | Player>
    • Optional withMessage: boolean
    • Optional damage: boolean

    Returns void

  • Immediately move the entity to the tile

    Parameters

    Returns void

  • Deprecated

    This is the correct way to change quality, but it is not completely implemented. It does not perform any required changes due to the quality change, like durability, all it does is change the quality and emit an event.

    Parameters

    Returns void

  • Keep our wells up-to-date with what is happening underground

    Parameters

    Returns IWell

  • Skips the next movement for this creature / npc

    Returns void

  • Skips the next update for this creature / npc

    Returns void

  • Returns void

  • Switch unlimited/limited water status based on underground water changes

    Returns void

  • Returns string

  • Parameters

    • human: undefined | default<unknown, number, NPC | Player>
    • Optional equip: boolean

    Returns default[]

  • Returns void

  • Parameters

    Returns void

  • Updates a bookcase's graphics and civilization score (based on if books are added).

    Parameters

    • items: default[]
    • add: boolean

      True if adding score, false if you are substracting.

    Returns void

  • Parameters

    Returns boolean

  • 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

  • Returns number

  • Parameters

    • value: any

    Returns value is default

  • Parameters

    • id: number

    Returns void

Generated using TypeDoc