Hierarchy

Properties

activeTurns? allowSmartMovementClientside? anim? asContainer asCorpse asCreature asDoodad asEntity asEntityMovable asEntityWithStats asGenericEntity asGenericHuman asHuman asItem asLoaded asLocalPlayer asNPC asNotLocalPlayer asPlayer asTile asTileEvent asUnion attackAnimationData? connectedVehicle connectedVehicleId? containedItems? containerType? crafted? cumulativeEvilCrafting? customization? days deathBy? defenses? description direction? entityType? equipEffects? equippedOffHandDisabled? equippedReferences? event? facingDirection? facingTile flyingDelay? fromTile fromX? fromY? handEquippedToLast? highestAttack? highestDefense? historicalActions? humansVisible id? identifier? inventory? invocations? isConnecting? isDead isFlying isGhost isHost isLoaded isLocalPlayer isMoving? isMovingSuppressVehicleClientside? isOnFire isResting isRestingCancelled isServer isSwimming isValid isWalkingTo isWithinHumanBounds island islandId? lastAttackedByEntity lastAttackedByEntityHuman lastAttackedByReference? lastGainedStat? lastReceivedRune? luck maelstromLevel manualTickActionDelay? messages? moveType? movementCompleteZ? movementIntent? movingData? nextMoveDirection? nextMoveTime? notes? options? persistentMarker? point preventRendering? quests? realTimeTickActionDelay? reference referenceId? renamed? respawnPoint? restData? score? shouldSkipNextMovement? skill? skills? slippingData sort? sortDirection? stat? state? stats? status? tamedCreatures? ticksSpent? tile tileUpdateType? tilesAround turns? type? vehicleItemReference? walkSoundCounter? walkToInProgress? x? y? z?

Methods

addDelay? addMarkerIcon? addMilestone? addReferenceId? addTag? addTamedCreature? animate? animateAttack? animateBumpTowards? applyTravelingEffects? asNot? asType? burn? calculateDamageAmount? calculateEquipmentStats? canCombatTides? canInspect? canSailAway? canSailTo? canSeeObject? canSeePosition? canSeeTile? canSwapWith? cancelResting? causeStatus? checkForGather? checkForGatherFire? checkForStill? checkForTargetInRange? checkForWell? checkUnder? clearTileCache? cloneItemIntoInventory? computeLights? connectVehicle? createFire? createItemInInventory? createMessageManager? createNoteManager? createQuestManager? createSkillManager? damage? damageByInteractingWith? damageRandomEquipment? disconnectVehicle? discoverRecipe? discoverRecipes? discoverVulnOrResist? ensureDelay? equip? extinguishTorchesIfSwimming? faceDirection? findPathToPort? getActiveStatuses? getAsHuman? getAttack? getBarteringBonus? getBurnDamage? getCombatStrength? getConsumeBonus? getCraftingDifficulty? getCurse? getDamage? getDamageModifier? getData? getDefense? getDiscoveredVulnsAndResists? getEquipEffect? getEquipSlotForItem? getEquippedItem? getEquippedItems? getEquippedUseBenefits? getGameOptions? getGameOptionsBeforeModifiers? getInsulation? getJumpTile? getMaxHealth? getMaxWeight? getMoveType? getMovementDelay? getMovementIntent? getMovementPoint? getMovementProgress? getName? getProducedTemperature? getQualityBonus? getRangedAccuracy? getRangedSkillBonus? getScaledWeight? getSimplifiedCumulativeAttack? getSimplifiedCumulativeDefense? getSkillBonus? getStaminaDelay? getStatus? getStatusLevel? getStatuses? getVehicle? getWanderChance? getWanderHomePoint? getWanderHomeRadius? getWanderIdleChance? getWanderNewDirectionChance? getWeightOrStaminaMovementPenalty? getWeightStatus? giveRune? hasData? hasDelay? hasDiscoveredVulnOrResist? hasStatus? hasTag? healthSyncCheck? hurtHands? incrementIslandTickCount? isContainer? isCorpse? isCreature? isDoodad? isDualWielding? isEntity? isHuman? isItem? isNPC? isNearby? isOffHandDisabled? isPlayer? isTile? isTileEvent? isVehicleAllowedOnTile? kill? loadOnIsland? loadUi? moveTo? moveToIslandId? moveToIslandPosition? moveTowardsIsland? notifyItem? notifyStat? overrideNextMovement? passTurn? processInput? queueSoundEffect? queueSoundEffectInFront? rangeAction? refreshStatuses? removeData? removeMarkerIcon? removeTag? removeTamedCreature? resetChangeTimers? resetMovementIntent? resetStatTimers? setData? setHumansWithinBound? setMoveType? setName? setOptions? setPosition? setStatChangeTimerIgnoreDifficultyOptions? setStatus? setTamedCreatureEnemy? setVehicle? setZ? skipNextMovement? skipNextUpdate? staminaReduction? startResting? startSlipping? stopSlipping? tick? tickStatuses? toString? unequip? unequipAll? updateDirection? updateMovementIntent? updateRender? updateSlipping? updateStatsAndAttributes? updateStrength? updateSwimming? updateTablesAndWeight? updateVehicle? updateView? updateWalkTo? updateWeight? updateWorldTile? waitForWalkTo? walkToEntity? walkToTile?

Properties

activeTurns?: number = ...
allowSmartMovementClientside?: boolean

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

anim?: number = 0
asContainer: undefined | default<unknown, number, NPC | Player> & IUncastableContainer
asCorpse: undefined
asCreature: undefined
asDoodad: undefined
asEntity: undefined | default<unknown, number, NPC | Player, unknown>
asEntityMovable: undefined | default<unknown, number, NPC | Player, unknown>
asEntityWithStats: undefined | default<unknown, number, NPC | Player, unknown>
asGenericEntity: undefined | default<unknown, number, EntityReferenceTypes, unknown>
asGenericHuman: undefined | default<unknown, number, NPC | Player>
asHuman: undefined | default<unknown, number, NPC | Player>
asItem: undefined
asLoaded: undefined | default<unknown, number, NPC | Player>
asLocalPlayer: undefined | default
asNPC: undefined | default
asNotLocalPlayer: undefined | default<unknown, number, NPC | Player>
asPlayer: undefined | default
asTile: undefined
asTileEvent: undefined
asUnion: undefined | default | default | default | default | default | default | default
attackAnimationData?: IAttackAnimationData

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

connectedVehicle: undefined | default
connectedVehicleId?: number
containedItems?: default[] = []
containerType?: ContainerType
crafted?: SaferNumberIndexedObject<ICrafted> = {}
cumulativeEvilCrafting?: number = 0
customization?: ICustomizations
days: undefined | number
deathBy?: ISerializedTranslation = ...
defenses?: number[] = []
description: undefined | Readonly<unknown>
direction?: default = Vector2.ZERO
entityType?: EntityType
equipEffects?: Map<EquipEffect, EquipEffects> = ...
equippedOffHandDisabled?: default
equippedReferences?: Map<EquipType, default> = ...
event?: IEventEmitter<default<unknown, number, NPC | Player>, IHumanEvents>
facingDirection?: East | North | West | South = Direction.South
facingTile: undefined | default
flyingDelay?: number
fromTile: undefined | default
fromX?: number = 0

Note: This might not be a whole number.

fromY?: number = 0

Note: This might not be a whole number.

handEquippedToLast?: MainHand | OffHand = EquipType.OffHand
highestAttack?: number
highestDefense?: number
historicalActions?: PartialRecord<ActionType, number>
humansVisible: undefined | default<unknown, number, NPC | Player>[]
id?: number
identifier?: string
inventory?: IContainer = ...

Deprecated

(use the entity itself)

invocations?: PartialRecord<ItemType, number>
isConnecting?: boolean = false
isDead: undefined | boolean
isFlying: undefined | boolean
isGhost: undefined | boolean
isHost: undefined | boolean
isLoaded: undefined | boolean
isLocalPlayer: undefined | boolean
isMoving?: boolean

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

isMovingSuppressVehicleClientside?: boolean = false

Flag that will prevent a humans vehicle from showing up until the movement finishews

isOnFire: undefined | FireType
isResting: undefined | boolean
isRestingCancelled: undefined | boolean
isServer: undefined | boolean
isSwimming: undefined | boolean
isValid: undefined | boolean
isWalkingTo: undefined | boolean
isWithinHumanBounds: undefined | boolean
island: undefined | default
islandId?: `${number},${number}`
lastAttackedByEntity: undefined | default | default | default<unknown, number, NPC | Player> | default
lastAttackedByEntityHuman: undefined | default<unknown, number, NPC | Player>
lastAttackedByReference?: Reference
lastGainedStat?: Stat
lastReceivedRune?: Deity
luck: undefined | number
maelstromLevel: undefined | number
manualTickActionDelay?: number
messages?: IMessageManager
moveType?: MoveType
movementCompleteZ?: number

Only used for Human entities

movementIntent?: IMovementIntent = {}
movingData?: IMovingData = {}

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

nextMoveDirection?: None | East | North | West | South
nextMoveTime?: number = 0
notes?: INoteManager
options?: ImmutableObject<IOptions> = ...
persistentMarker?: {
    guid: string;
    type: Tamed;
}

Notifier marker assigned to this entity

Type declaration

  • guid: string
  • type: Tamed
point: undefined | IVector3
preventRendering?: boolean
quests?: IQuestManager
realTimeTickActionDelay?: number = 0
reference: undefined | [id: number, type: NPC, context?: ReferenceContext, islandId?: `${number},${number}`, objectId?: number] | [id: number, type: Player, context?: ReferenceContext, islandId?: `${number},${number}`, objectId?: number]
referenceId?: number
renamed?: string | ISerializedTranslation
respawnPoint?: IVector4
restData?: IRestData
score?: number = 0
shouldSkipNextMovement?: true
skill?: default
skills?: Record<SkillType, {
    bonus: number;
    core: number;
}>
slippingData: undefined | ISlippingData
sortDirection?: SortDirection
stat?: default<default<unknown, number, NPC | Player>> = ...
state?: PlayerState = PlayerState.None
stats?: IStats
status?: IStatus
tamedCreatures?: Map<`${number},${number}`, Set<number>> = ...
ticksSpent?: Map<`${number},${number}`, number> = ...
tile: undefined | default
tileUpdateType?: TileUpdateType
tilesAround: undefined | default[]
turns?: number = 1
type?: number
vehicleItemReference?: default
walkSoundCounter?: number = 4
walkToInProgress?: IWalkToPathInProgress
x?: number
y?: number
z?: WorldZ

Methods

  • Parameters

    • delay: number
    • Optional replace: boolean
    • Optional addStaminaDelay: boolean
    • cap: number = Infinity

    Returns void

  • Parameters

    Returns void

  • Parameters

    • milestone: Milestone
    • Optional data: string | number
    • Optional update: boolean

    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

  • Applies traveling effects to the player

    • Loses stamina, hunger, and thirst
    • Damages spyglass, golden sextant, and boat if it's being used
    • Decays items in the player's inventory

    Parameters

    Returns void

  • Parameters

    • type: number

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

  • Burn the player/NPC

    Parameters

    • fireType: FireType
    • skipMessage: boolean = false
    • Optional skipParry: boolean
    • Optional equipType: EquipType
    • Optional fromCombat: boolean
    • level: number = 1
    • Optional thing: default | default

    Returns undefined | number

  • Parameters

    Returns number

  • Returns void

  • Parameters

    Returns boolean

  • Parameters

    • x: number
    • y: number

    Returns boolean

  • Parameters

    • type: CanASeeBType
    • islandId: `${number},${number}`
    • x: number
    • y: number
    • z: number
    • Optional fieldOfView: FieldOfView
    • Optional customRadius: number

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    Returns void

  • Returns undefined | default

  • Returns undefined | default

  • Check if there is a still in front of the player.

    Parameters

    • Optional withWater: boolean

      Check if the still has water in it?

    • Optional isLit: boolean

      Check if the still is lit?

    Returns boolean

  • Parameters

    • towardsTile: undefined | default
    • range: number
    • accuracy: undefined | number
    • Optional includePlayers: boolean

    Returns IMobCheck

  • Parameters

    • towardsTile: undefined | default
    • range: number
    • accuracy: undefined | number
    • includePlayers: undefined | boolean
    • clientSide: true

    Returns IMobCheck[]

  • Returns boolean

  • Returns void

  • Parameters

    Returns default

  • Recompute lights around the human

    Returns void

  • Parameters

    Returns void

  • Creates a fire at a given tile and assigns the player as its creator.

    Parameters

    Returns undefined | default

  • Returns IMessageManager

  • Returns INoteManager

  • Returns IQuestManager

  • Returns default

  • Parameters

    Returns undefined | number

  • Returns void

  • Parameters

    • animate: boolean = true

    Returns void

  • Parameters

    • recipeType: ItemType
    • crafted: ICrafted = ...
    • Optional discoveredClientSide: boolean
    • emit: boolean = true

    Returns void

  • Parameters

    • recipes: [recipeType: ItemType, crafted: ICrafted][]
    • Optional discoveredClientSide: boolean

    Returns void

  • Parameters

    Returns void

  • Parameters

    • delay: number

    Returns void

  • Parameters

    • item: default
    • slot: EquipType
    • internal: boolean = false
    • skipRevertItem: boolean = false

    Returns boolean

  • Extinguishes all torches the player is holding of they are swimming.

    Returns void

  • Parameters

    • portId: number
    • Optional options: Partial<{
          requireBoat: boolean;
          startReversed: boolean;
      }>

    Returns undefined | default[]

  • Generator for status effects on the entity.

    Returns default[]

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

  • Returns the bartering bonus for a given credit value

    Parameters

    • baseCredits: number

    Returns number

  • Parameters

    Returns number

  • Returns number

  • Parameters

    Returns number

  • Parameters

    Returns number

  • Returns number

  • Parameters

    Returns number

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

  • Returns Map<CreatureType, Set<DamageType>>

  • Parameters

    Returns Set<DamageType>

  • Type Parameters

    Parameters

    • type: E

    Returns FirstIfOne<EquipEffectByType<E>>

  • Parameters

    • item: default
    • Optional includeDisabled: true

    Returns undefined | EquipType

  • Parameters

    • slot: EquipType
    • Optional includeDisabled: true

    Returns undefined | default

  • Parameters

    • Optional includeDisabled: true

    Returns default[]

  • Gets the use benefits for all equipped items.

    Returns

    number that is the bonus amount the player recieves when consuming.

    Parameters

    • stat: Stat

      to check use benefits for.

    Returns undefined | {
        amount: number;
        items: default[];
    }

  • Returns ImmutableObject<IGameOptionsPlayer>

  • Returns ImmutableObject<IGameOptionsPlayer>

  • Parameters

    Returns number

  • Returns undefined | default

  • Gets the max health of the player.

    Returns the result of the "getMaxHealth" event, or the max in Stat.Health, if the result of the hook is undefined.

    Parameters

    • withBonus: boolean = true

    Returns number

  • Gets the strength of the player.

    Returns the result of Hook.GetPlayerStrength, or the max in Stat.Health, if the result of the hook is undefined.

    Used internally for Stat.Weight.max

    Returns number

  • Returns MoveType

  • Returns number

  • Note: This is usually only ran on the server

    Returns IMovementIntent

  • Parameters

    • timeStamp: number

    Returns IVector2

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

    Parameters

    • timeStamp: number

    Returns number

  • Returns default

  • Returns undefined | number

  • Parameters

    Returns number

  • Parameters

    Returns number

  • Gets this human's current carried weight, scaled down to what it would be without any weight bonuses applied

    Returns number

  • Returns number

  • Returns number

  • Parameters

    Returns number

  • Gets a stamina penalty delay to be used for slowed actions and movement.

    Parameters

    • staminaToStartAddingDelayAt: number = STAMINA_LOW_PENALTY_START_VALUE

      Stat value where delays start getting added from.

    Returns number

  • Returns the handler for this status effect, whether or not this entity currently has the effect.

    Type Parameters

    Parameters

    Returns undefined | S

  • Returns the handler for this status effect, whether or not this entity currently has the effect.

    Parameters

    Returns number

  • Generator for status effects on the entity.

    Returns default[]

  • Returns undefined | IItemVehicle

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Returns undefined | IVector2

  • Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Parameters

    • defaultChance: number

    Returns undefined | number

  • Returns number

  • Returns WeightStatus

  • Returns

    whether the rune was given

    Parameters

    • deity: ArrayOr<DeityReal>

      The deity to potentially give a rune for

    • chance: number

      A chance multiplier on top of the base rune chance of 10% (an additional 30% chance may be added by theurgy)

    • domain: `event:${number}` | `craft:${number}` | `action:${number}` | `skill:${number}` | `killcreature:${number}` | `tamecreature:${number}` | `killnpc:${number}`
    • context: default

    Returns boolean

  • Check if a data was set

    Returns

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

    Parameters

    • key: string

      Data key

    Returns boolean

  • Returns boolean

  • Parameters

    Returns boolean

  • Returns whether the entity has the given StatusType

    Parameters

    Returns number

  • Parameters

    • tag: unknown

    Returns boolean

  • Parameters

    • reason: string

    Returns void

  • Parameters

    Returns boolean

  • Returns void

  • Returns this is default

  • Returns this is default

  • Returns this is default

  • Returns boolean

  • Returns this is default<unknown, number, NPC | Player>

  • Returns this is default

  • Returns this is default

  • Returns boolean

  • Returns this is default

  • Returns this is default

  • Returns this is default

  • Parameters

    Returns boolean

  • Returns void

  • Loads the player onto an island Called when the game is initially loading and moving a player to another island

    Parameters

    Returns void

  • Loads ui. Should only be called if this player is local

    Returns void

  • Move the entity to the tile

    Parameters

    Returns boolean

  • Moves this player to another island

    Parameters

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • This is only ran on the server

    Parameters

    • timeStamp: number

    Returns undefined | IMovementIntent

  • Parameters

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

    Returns void

  • Parameters

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

    Returns void

  • 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

  • Parameters

    • tag: unknown

    Returns void

  • Parameters

    Returns boolean

  • Returns void

  • Returns void

  • Sets a data

    Rturns

    The value

    Type Parameters

    • T

    Parameters

    • key: string

      Data key

    • value: T

      Data value

    Returns T

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Immediately move the entity to the tile

    Parameters

    Returns void

  • Parameters

    • stat: IStat | Stat
    • timer: number
    • Optional amt: number

    Returns void

  • Parameters

    Returns boolean

  • Parameters

    Returns void

  • Parameters

    • item: undefined | default
    • Optional extinguishTorches: boolean

    Returns boolean

  • Parameters

    • z: number
    • allowCancelation: boolean = true
    • updateFlowField: boolean = true

    Returns boolean

  • Skips the next movement for this creature / npc

    Returns void

  • Skips the next update for this creature / npc

    Returns void

  • Parameters

    • Optional skill: SkillType
    • Optional level: number

    Returns void

  • Parameters

    Returns void

  • Returns void

  • Ticks a player

    Returns

    True if the game should tick after this

    Parameters

    • Optional isPassTurn: boolean
    • Optional turnType: TurnTypeFlag

    Returns boolean

  • Updates caused by status effects such as bleeding, poison, and burns.

    Returns void

  • Returns string

  • Unequips an item. Note: This is safe to call even if the item isn't equipped. it'll do nothing in that case.

    Parameters

    • item: default
    • internal: boolean = false
    • skipMessage: boolean = false
    • skipRevertItem: boolean = false
    • isArmorStandSwap: boolean = false

    Returns boolean

  • Unequip all equipment

    Parameters

    • displayMessage: boolean = true
    • isArmorStandSwap: boolean = false

    Returns IEquip[]

  • Parameters

    Returns boolean

  • Returns void

  • This needs to be called whenever the player's strength requires an update.

    Example usage includes:

    1. When max health changes. Max health is used in calculating the strength.
    2. If a mod is using the GetPlayerStrength hook and the calculation needs to be refreshed.

    Returns void

  • Returns void

  • Parameters

    • source: string

    Returns void

  • Returns void

  • Parameters

    • source: string

    Returns void

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

    Parameters

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

    Returns void

  • Returns a promise that resolves once the walk finishes

    Returns Promise<void>

  • Parameters

    Returns Promise<boolean>

  • Parameters

    Returns Promise<boolean>

Generated using TypeDoc