Entity class that allows movement

Hierarchy

Implements

Constructors

Properties

Accessors

Methods

acquireNotify addCreature addDecayTime addMagicalProperties addMagicalProperty addMarkerIcon addReferenceId addTag animate animateAttack animateBumpTowards asNot asType canBeRefined canBurnPlayer canDecay canHaveCooldown canInspect canSeeObject canSeePosition canSeeTile canSwapWith changeInto clearTileCache copyPropertiesFrom countTradesWith createOnBreak damage dropInWater dropItemsOnMelt extinguish getAttackDamage getAttackWithBonus getBaseDefense getBaseDefenseWithBonus getBaseTemperature getBestRangedWeapon getBookcaseFullness getCivilizationScore getContainerInsulation getContainerWeightReduction getCooldown getCraftQualityBonus getCraftTierBonus getCurrentOwner getDamageModifier getDamageType getDamageTypesForSkill getDamagedThreshold getData getDecayAtStart getDecayRate getDecayTime getDecayedThreshold getDescription getDisassemblyItems getDisplayItem getDriver getDurabilityCharge getEquipSlot getEquipmentInsulation getEquippedHuman getInheritItemRecipeSkill getItemUseBonus getMagicalPropertyInfo getMaxDecayTime getMaxDurability getMaxReinforcement getMoveType getMovementDelay getMovementOptions getMovementPoint getMovementProgress getName getOnUseBonus getOwner getPreservationDecayMultiplier getProducedTemperature getRangedAttackWithBonus getStokeFireBonusValue getStokeFireValue getTemperatureDecayMultiplier getTotalWeight getValidMagicalProperties getVehicle getVisualCooldown getVisualDecay getVisualDurability getWanderChance? getWanderHomePoint? getWanderHomeRadius? getWanderIdleChance? getWanderNewDirectionChance? getWeaponWeight getWeight getWeightCapacity getWorth hasData hasTag initializeMagicalPropertyManager isContainer isCorpse isCreature isDamaged isDecayed isDoodad isEntity isEquipped isHuman isInGroup isInTradeContainer isItem isNPC isNearby isPlayer isProtected isTile isTileEvent isVehicleAllowedOnTile moveTo moveToTile moveToTileWithMobCheck notifyItem notifyStat onMovementCompleted onUnserialized overrideNextMovement placeOnTile postProcessDecay queueSoundEffect queueSoundEffectInFront reduceDecayTime removeData removeMagic removeMarkerIcon removeTag rerollMagicalProperty rerollMagicalPropertyValues resetDecayTime restoreCreature returns revertFromDisassembly revertFromDoodad setAttackDefenseBonus setCachedTile setData setDecayTime setFromPosition setHumansWithinBound setMagicalChanceFromQuality setMoveType setMoving setName setPosition setQuality setUsed skipNextMovement skipNextUpdate spawnCreatureOnItem spawnOnDecay spawnSlithSucker startSlipping stopSlipping toString tryRestoreCreature updateDirection updateItemDisplay updateRender updateSlipping updateTileWhenMoving updateView updateWorldTile verifyAndFixItem verifyAndFixMagic verifyMagicalItemWeight verifyMagicalProperties willBreakOnDamage

Constructors

Properties

[SYMBOL_CONTAINER_CACHED_REFERENCE]?: ContainerReference
_description?: IItemDescription
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
bonusDefense?: number
book?: BookType
constructedFrom?: IConstructedInfo
containedItems?: default[]
containedWithin?: IContainer
containsCreature?: default
crafterIdentifier?: string
direction?: default

undefined = Vector2.ZERO for this

disassembly?: default[]
driverReference?: Reference<NPC | Player>
equippedReference?: Reference<NPC | Player>
event: IEventEmitter<default, IItemEvents>
facingDirection?: East | North | West | South

undefined = Direction.None for this

fireStage?: FireStage
fromX?: number

Note: This might not be a whole number.

fromY?: number

Note: This might not be a whole number.

historicalActions?: PartialRecord<ActionType, number>
holderReference?: Reference<NPC | Player>
id: number
isMoving?: boolean

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

islandId: `${number},${number}`
magic?: default
map?: default
moveType?: MoveType
movementCompleteZ?: number

Only used for Human entities

movingData: IMovingData = {}

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

offsetX?: number
offsetY?: number
persistentMarker: undefined | {
    guid: string;
    type: Tamed;
}

Notifier marker assigned to this entity

preventRendering?: boolean
protected?: boolean
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
stacks?: Set<ItemType>
startingDecay?: number
tradedFrom?: string[]

Includes merchant identifiers for each instance of the item being traded to/from the merchant.
(The property name is out of date.)

type: ItemType
used?: IItemUsed
vehicleFacingDirection?: East | North | West | South
weight: number
weightCapacity?: number
weightFraction?: number
x: number
y: number
z: WorldZ

Accessors

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

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

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

  • 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 isTransient(): boolean
  • Returns boolean

  • 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(): undefined | IVector3
  • Location of the entity on the world. Parent classes will probably mark this as always defined

    Returns undefined | IVector3

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

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

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

    Returns undefined | default

  • get tileUpdateType(): TileUpdateType
  • Returns TileUpdateType

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

Methods

  • Parameters

    • creature: default
    • Optional remainTamed: boolean

    Returns void

  • Increases the time until the item will decay (ticks until it decays at 1x decay speed).

    Parameters

    • time: number = 0

    Returns undefined | number

  • Parameters

    • count: number
    • source: string = ""

    Returns boolean

  • Parameters

    Returns void

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

    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

  • Can the item be refined based on disassembly items and minimum getWeight tables?

    Returns boolean

  • Checks to see if the item is in a fire/hot thing

    Returns boolean

  • Returns the maximum decay of an item, or undefined if the item does not have the decayMax or storeDecay property.

    Returns

    A number or undefined.

    Returns undefined | 1

  • 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 void

  • Parameters

    Returns void

  • Parameters

    Returns number

  • Parameters

    Returns void

  • Parameters

    • source: string

      A string representing the reason for this damage. Used for multiplayer debugging. Just put a unique string of characters here

    • Optional modifier: number

      The amount of damage to take. Defaults to 1.

    • Optional min: number

      The minimum durability that this item should have remaining. Defaults to n/a

    Returns ItemDamageResult

  • Parameters

    Returns void

  • When the item melts, it will leave behind items that are specified in the leaveDissassemblyItemsOnMelt property

    Parameters

    • container: IContainer

      The container to leave the items in or on

    Returns void

  • Extinguishes to item if it is lit.

    Parameters

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

      Human entity that is carrying the item to extinguish.

    Returns void

  • Gets the attack damage with its bonus value. Note: This does not get the value with any magical properties applied.

    Returns

    number The attack value with bonus applied.

    Returns number

  • Get the base defense of an item plus its magical defense stat if applicable

    Returns number

  • Gets the base defense with its bonus value. Note: This does not get the value with any magical properties applied.

    Returns

    number The base defense value.

    Returns number

  • Returns undefined | number

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

    Returns

    DisplayableItemType equal to which graphic it should show.

    Returns undefined | ItemTypeExtra

  • Gets civilization score based on item's quality and type (if it can be build/set down) but without the magical property values.

    Returns

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

    Parameters

    • actionType: SetDown | Build

      Either Build or SetDown as they are the only types that can use civilization score.

    Returns number

  • Parameters

    Returns number

  • Returns the container weight reduction

    Returns

    1 if there is no reducton or [-50% + magical storing values]

    Parameters

    Returns number

  • Returns

    The cooldown for this item. 0 = just started cooldown, 1 = finished cooldown

    Parameters

    Returns number

  • Used to return the quality bonuses for crafting with superior/remarkable/exceptional items

    Parameters

    • Optional required: boolean

    Returns number

  • Item tier bonus

    Parameters

    Returns number

  • Gets the current human that has the item in their inventory

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

  • Gets the item's damage modifier which certain special items have so they can have high durability for use, but normal damage ranges.

    Returns number

  • Returns the damage types associated with a skill with a fallback for whatever damage types the item normally provides

    Parameters

    • skillType: SkillType

      The skill to get default damage types from

    Returns undefined | DamageType[]

  • Returns number

  • 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

  • Parameters

    • isClientSide: boolean

    Returns number

  • Gets the ticks until this item will decay at 1x decay speed.

    Parameters

    • resetIfUnset: boolean = false

      True if it should reset decay if it doesn't exist

    Returns undefined | number

  • Returns number

  • Get the driver for this item (if it's a vehicle with a driver)

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

  • Returns the durability of the item based on the max durability to be used as a pseudo "charge"

    Returns number

  • Parameters

    • Optional includeDisabled: true

    Returns undefined | EquipType

  • Parameters

    Returns number

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

  • Gets the inherit item type.

    Returns SkillType

  • Gets the item's quality and action level (how good it is at doing the action).

    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

  • Gets the item's max decay value based on quality. The max number can be modified slightly due to overrideDefault (crafting) and adding fuel which goes over this max.

    Returns

    A number equal to the maximum item decay or undefined if the item should not have decay at all.

    Parameters

    • Optional overrideDefault: number

      Override the item's decayMax definition with something else.

    • Optional withRandomization: boolean

      True if you want to return a randomized value (useful when setting the value on an item).

    Returns undefined | number

  • Get the maximum durability for an item based on many factors.

    Returns

    The maximum durability of the item as a number.

    Parameters

    • human: default<unknown, number, NPC | Player>

      Player that we checking to get the maximum item durability (as game options can affect this).

    Returns number

  • Get the maximum reinforcement allowed for an item based on many factors.

    Returns

    The maximum reinforcement of the item as a number.

    Parameters

    • maxDurability: number

      The maximum durability that the item should have.

    • actionTier: number

      Any bonus from the item's action tier.

    Returns number

  • Returns number

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

    Parameters

    • timeStamp: number

    Returns number

  • Returns number

  • Gets the owner of this item. This will be the human who crafted it. Note: The owner might be different than the human whose inventory the item is currently in

    Returns undefined | default

  • 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

  • Gets the ranged attack damage with its bonus value. Note: This does not get the value with any magical properties applied.

    Returns

    number The ranged attack value with bonus applied.

    Returns number

  • Returns number

  • Returns undefined | number

  • Parameters

    • isClientSide: boolean

    Returns number

  • Parameters

    • Optional bypassContainer: boolean
    • Optional targetContainer: IContainer

    Returns number

  • Parameters

    Returns number

  • Returns number

  • Returns number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Returns number

  • Deprecated

    This method currently shouldn't be used in production code, as it's to do with the new crafting system. Stay tuned.

    Returns number

  • Returns undefined | number

  • Gets the worth of an item used for merchant trading. Does not consider bartering or modifiers bonuses; use Item.getTraderSellPrice for that.

    Parameters

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

      The human that is trading the item for its worth (used for durability calculations).

    • magicalWorth: boolean = true

      Include the value of MagicalPropertyType.Worth, defaults to true

    Returns 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

    Returns boolean

  • Returns default

  • Returns this is default

  • Returns this is default

  • Returns boolean

  • Returns boolean

  • Returns this is default

  • Parameters

    • Optional includeDisabled: true

    Returns boolean

  • Parameters

    Returns boolean

  • Returns boolean

  • Returns this is default

  • Returns this is default

  • Returns this is default

  • Returns boolean

  • Returns this is default

  • Returns this is default

  • Unsupported

    Returns boolean

  • Moves an item to a target point / container while animating it

    Returns

    True if the movement is happening, false if it wasn't able to move

    Parameters

    Returns boolean

  • Returns void

  • Parameters

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

    Returns void

  • Parameters

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

    Returns void

  • Decreases the time until the item will decay (ticks until it decays at 1x decay speed).

    Parameters

    • time: number = 0

    Returns undefined | number

  • 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

  • Returns void

  • Resets the item's decay with some added randomization.

    Parameters

    • Optional overrideDefault: number

    Returns void

  • Parameters

    • tile: default
    • Optional preventRendering: boolean

    Returns undefined | default

  • Returns and item based on returnOnUseAndDecay.

    Parameters

    • Optional disableNotify: boolean

      Set to true if no notification should be shown for the new item above the player.

    • Optional craft: boolean

      Set to true when returning consumed items to check for whenCrafted property in returnOnUseAndDecay.

    Returns boolean

  • Reverts properties of an item from a disassembly item (IItemDisassembly)

    Parameters

    • disassemblyItem: IItemDisassembly

      Disassembly item to revert from

    • Optional placeOnTile: default

      Place the item on a tile after reverting if set to a tile

    Returns void

  • Parameters

    Returns void

  • Gives bonus attack and defense to items with have quality. Example: Superior quality can get a bonus of 1-2; relics can get 5-10.

    Returns

    true if bonusDefense/Attack was set.

    Returns boolean

  • Sets a data

    Rturns

    The value

    Type Parameters

    • T

    Parameters

    • key: string

      Data key

    • value: T

      Data value

    Returns T

  • Sets the item's decay time (ticks until it decays at 1x decay speed).

    Parameters

    • Optional decayTime: number

    Returns void

  • Parameters

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

    Returns void

  • Sets the item as magical with a chance based on quality (and clears any existing magical properties)

    Returns

    True if the item has become magical

    Parameters

    • contextualChanceMultiplier: number = 1

      The number that chances get multiplied by, for example, 2 or 3. Currently used based on skill, island distance, etc

    • Optional quantityOverride: number

      The number of properties to use instead of generating the quantity randomly

    Returns boolean

  • Parameters

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

    Returns void

  • Immediately move the entity to the tile

    Parameters

    Returns void

  • Parameters

    Returns void

  • Skips the next movement for this creature / npc

    Returns void

  • Skips the next update for this creature / npc

    Returns void

  • Parameters

    • tile: default
    • creatureType: undefined | CreatureType
    • Optional forceAberrant: boolean
    • Optional bypass: boolean
    • Optional preferFacingTile: default<unknown, number, NPC | Player>
    • maxTilesChecked: number = 27

    Returns undefined | default

  • Parameters

    Returns undefined | default

  • Spawns a slither sucker from its item form.

    Parameters

    • tile: default

      The tile to attempt to spawn on to.

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

      The human the creature is facing from (in the case where we prefer facing tile).

    Returns void

  • Returns void

  • Returns string

  • Tries restoring the creature on the target tile and fans out to nearby tiles if it's occupied

    Parameters

    • tile: default
    • Optional preventRendering: boolean

    Returns undefined | default

  • Update the item's display (in the case that its extras are used).

    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

  • Fixes item issues. Note: This is not called by clients joining a mp game.

    Returns void

  • Returns void

  • Verifies an item has a proper weight combined with its magical item weight (featherweight) property and changes it if not.

    Returns

    A type of change via ItemWeightChange for showing a new magical property was added or a new magical weight was added. If no change happened, it will return undefined.

    Returns undefined | ItemWeightChange

  • Verifies an item has the proper magical properties and rerolls individual ones if needed.

    Returns

    True if the item had a glowing magical property.

    Returns boolean

  • Check if an item will break on damage.

    Returns

    True or false if the item will be broken when being damaged.

    Parameters

    Returns boolean

Generated using TypeDoc