Item()

new Item()

Properties:
Name Type Attributes Description
area Area

Area the item belongs to (warning: this is not the area is currently in but the area it belongs to on a fresh load)

metadata object

Essentially a blob of whatever attrs the item designer wanted to add

behaviors Array

list of behaviors this object uses

description string

Long description seen when looking at it

id number

vnum

isEquipped boolean

Whether or not item is currently equipped

equippedBy Character <nullable>

Entity that has this equipped

inventory Map

Current items this item contains

name string

Name shown in inventory and when equipped

room Room <nullable>

Room the item is currently in

roomDesc string

Description shown when item is seen in a room

script string

A custom script for this item

type ItemType | string
uuid string

UUID differentiating all instances of this item

closeable boolean

Whether this item can be closed (Default: false, true if closed or locked is true)

closed boolean

Whether this item is closed

locked boolean

Whether this item is locked

lockedBy entityReference <nullable>

Item that locks/unlocks this item

carriedBy Character | Item <nullable>

Entity that has this in its Inventory

Extends

Methods

addItem(item)

Add an item to this item's inventory

Parameters:
Name Type Description
item Item

close()

Close a container-like object

findCarrier() → {Character|Item|null}

Helper to find the game entity that ultimately has this item in their Inventory in the case of nested containers. Could be an item, player, or

Returns:
Character | Item | null -

owner

initializeInventory(inventory)

Create an Inventory object from a serialized inventory

Parameters:
Name Type Description
inventory object

Serialized inventory

isInventoryFull() → {boolean}

Returns:
boolean

lock()

Lock a container-like object

open()

Open a container-like object

removeItem(item)

Remove an item from this item's inventory

Parameters:
Name Type Description
item Item

unlock()

Unlock a container-like object

Events

channelReceive

Docs limit this to be for GameEntity (Area/Room/Item) but also applies to NPC and Player

Parameters:
Name Type Description
channel Channel
sender Character
rawMessage string
Inherited From:

equip

Parameters:
Name Type Description
equipper Character

spawn

unequip

Parameters:
Name Type Description
equipper Character

updateTick