Hierarchy

Methods

  • Called when something is built on a tile

    Parameters

    • item: default

      The item used to build the object

    • tile: default

      The tile something was built on

    • doodad: default

      The doodad that was created on the tile

    Returns void

  • Returns any

  • Called before an npc attacks

    Returns

    False if the npc cannot attack, or undefined to use the default logic

    Parameters

    • weapon: undefined | default

      The weapon used to attack

    • attackType: AttackType

      The attack type

    Returns undefined | boolean

  • Called when the walk path of the player is about to change.

    Returns

    False to prevent the walk path change or undefined to use the default logic

    Parameters

    Returns undefined | false

  • Called before consuming an item

    Returns

    True if the human can consume the item (default logic isn't called, should use your own code for consumption), false if the human cannot consume the item, or undefined to use the default logic

    Parameters

    Returns undefined | boolean

  • Deprecated

    Use filterDroppable

    Parameters

    Returns undefined | boolean

  • Called when movement is attempted on the server

    Returns

    False to prevent movement or undefined to use the default logic

    Parameters

    Returns undefined | false

  • Called when a npc tries to attack

    Returns

    True if the npc can attack, false if the npc cannot attack, or undefined to use the default logic

    Returns undefined | boolean

  • Called when a npc tries to move

    Returns

    True if the npc can move, false if the npc cannot move, or undefined to use the default logic

    Parameters

    • tile: default

      The tile the npc is trying to move to

    • moveType: MoveType

      The npcs move type

    Returns undefined | boolean

  • Called when the human changes their layer (z position)

    Parameters

    • z: number
    • oldZ: number

    Returns any

  • NPC is being removed or the game is ending

    Returns void

  • Called when the entity is created in the game Also called for players that "rejoin" the game

    Returns void

  • Called when the human is damaged

    Returns

    The amount of damage the player should take (the player will take this damage)

    Parameters

    Returns number | void

  • Used for deregistering events

    Returns any

  • Called when the human is killed.

    Returns any

  • Parameters

    Returns any

  • Called when the human equips an item to a slot

    Parameters

    Returns any

  • Called when the human fails to equip an item to a slot

    Parameters

    Returns any

  • Called in Drop.canUse()

    Returns

    an Item[] if filtering, undefined to allow all of these items to be dropped

    Parameters

    • items: default[]

      The items that will be dropped

    • tile: default

      The tile the items will be dropped on

    Returns undefined | default[]

  • Called when getting the player's maximum health

    Parameters

    • maxHealth: number

      The current max health of the player (after any other previous mods)

    Returns number

  • Called when getting the player's maximum weight

    Parameters

    • maxWeight: number

      The current max weight of the player (after any other previous mods)

    Returns number

  • Called when getting the players movement intent

    Returns

    The movement intent of the player or undefined to use the default logic

    Returns undefined | IMovementIntent

  • Called when getting the players weight or stamina movement penalty

    Returns

    The weight/stamina movement penalty for the player or undefined to use the default logic

    Returns undefined | number

  • Called when getting the players weight status

    Returns

    The weight status of the player or undefined to use the default logic

    Returns undefined | WeightStatus

  • Parameters

    Returns undefined | boolean

  • Called when an item is added to the player's inventory

    Parameters

    • items: default[]
    • container: IContainer

      The container object the items were added to. This container might be inventory or a container within the inventory.

    Returns any

  • Called when an item is removed from the players inventory

    Parameters

    • items: default[]
    • container: IContainer

      The container object the items were moved to.

    Returns any

  • Called when an item is moved from one container to another, while still in the players inventory.

    Parameters

    • items: default[]

      The items

    • container: IContainer

      The container object the items were moved to. This container might be inventory or a container within the inventory.

    • Optional previousContainer: IContainer

      The container object the items were moved from. This container might be inventory or a container within the inventory.

    Returns any

  • Called when checking if a human is swimming

    Returns

    True if the human should be swimming, false if they should not be swimming, or undefined to use the default logic

    Parameters

    • isSwimming: boolean

      True if the human is swimming

    Returns undefined | boolean

  • Called when an entity is killed by another entity.

    Parameters

    Returns void

  • Called when the human is loaded onto an island

    Parameters

    Returns any

  • Called when the player completes a movement

    Returns any

  • Called when the human is moving to another island

    Parameters

    • oldIsland: default

      The humans old island

    • newIsland: default

      The humans new island

    Returns any

  • Called when no input is received

    Returns any

  • Called when a book is opened by a player

    Parameters

    Returns void

  • Called when an doodad is picked up

    Parameters

    • doodad: default

      The doodad object

    Returns any

  • Called after moving.

    Parameters

    Returns void

  • Called before moving. Can be called twice for humans

    Parameters

    • fromTile: default
    • toTile: default
    • isMoving: boolean

      True the second time it's called, right as the entity is about to actually move

    Returns undefined | boolean | void

  • Called when the human is moving to another island

    Parameters

    • oldIsland: default

      The humans old island

    • newIslandId: `${number},${number}`

      The humans new island

    Returns any

  • Called when input is being processed on the server

    Returns

    False to prevent input processing or undefined to use the default logic

    Returns undefined | false

  • NPC is spawned / ready to do things

    Returns void

  • Called when the entity is removed from the game

    Returns void

  • Called when the entity is renamed

    Returns void

  • Used for registering events This may be called more than once on the same player

    Returns any

  • Called when the player stops resting

    Parameters

    • restData: IRestData

      The data related to the rest event

    Returns any

  • Called when the player starts resting

    Parameters

    • restData: IRestData

      The data related to the rest event

    Returns any

  • Called when the human position is set, from a teleport type of movement

    Parameters

    • tile: default

      Tile the human is now on

    Returns void

  • Called when the human will be killed. If any handlers return false to stop the human from dying, no further handlers will be called.

    Returns

    false to stop the human from dying

    Returns false | void

  • Parameters

    • skill: SkillType

      The skill that is changing

    • value: number

      The new skill value (core + bonus)

    • oldValue: number

      The previous skill value (previous core + bonus)

    Returns any

  • Returns

    True if the skill check should pass, false if it shouldn't, undefined if it should be random

    Parameters

    • skill: SkillType

      The skill that is being checked

    • check: number

      The desired value that needs to pass

    • Optional actionTier: number

      Optional action tier

    Returns undefined | boolean

  • Called when the human is spawned. (At the end of Player.setup / NPC.spawn)

    Returns any

  • Called when a stat changes, for any reason

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    • Optional oldValue: number

      The value that the stat changed from

    • Optional info: IStatChangeInfo<any>

      An IStatChangeInfo object describing why the change occurred. It will always be passed with a reason

    Returns void

  • Called when a stat changes, for any reason

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    • oldValue: number

      The value that the stat changed from

    • info: IStatChangeInfo<any>

      An IStatChangeInfo object describing why the change occurred. It will always be passed with a reason

    Returns void

  • Called when a stat's max value changes, for any reason

    Parameters

    • stat: IStatMax

      An IStat object, the stat that was affected

    • Optional oldValue: number

      The value that the stat changed from

    • Optional info: IStatChangeInfo<any>

      An IStatChangeInfo object describing why the change occurred. It will always be passed with a reason

    Returns void

  • Called when a stat timer changes

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    • Optional oldValue: number

      The value that the stat changed from

    Returns void

  • Called when a stat timer is removed

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    Returns any

  • Called when a stat timer will change

    Returns

    false to cancel the stat timer change, undefined otherwise.

    Parameters

    • stat: IStat

      An IStat object, the stat that will be affected

    • changeFactory: StatChangeTimerFactory

      An object for manipulating how the new stat change timer will be set

    Returns undefined | false

  • Called when this entity gets or loses a status effect

    Parameters

    • status: StatusType

      The type of status effect that was gained or lost

    • level: number

      Whether the entity now has the status effect

    • reason: StatusEffectChangeReason

      The reason for the change

    Returns void

  • Called when the player tick ends

    Returns any

  • Called when the player tick starts

    Returns any

  • Called when a turn is ending

    Returns any

  • Called when a turn is starting

    Returns any

  • Called when the human unequips an item from a slot

    Parameters

    • item: default

      The item being unequipped

    • slot: EquipType

      The slot it was equipped in

    Returns any

  • Called when the human faces a different direction

    Parameters

    • direction: Direction

      The direction the player is now facing

    Returns void

  • Type Parameters

    Parameters

    • key: O

      The key of IOptions that was changed on this player

    • value: IOptions[O]

      The value this key was set to

    Returns any

  • Called when the players weight is being updated

    Returns

    A number to set the player weight to or undefined to use the default logic

    Parameters

    • newWeight: number

      The new weight of the player

    Returns undefined | number

  • Called when the walk path of the player changes.

    Parameters

    Returns any

Generated using TypeDoc