Item

Item

The Item entity. This base Item refers primarily to items which are not currently owned.

Constructor

new Item()

Source:

Members

(static) config

Source:

Configure the attributes of the ChatMessage Entity

actor :Actor|null

Source:

A convenience reference to the Actor entity which owns this item, if any

Type:

img :string

Source:

A convenience reference to the image path (data.img) used to represent this Item

Type:
  • string

isOwned

Source:

A flag for whether the item is owned by an Actor entity

limited

Source:

A boolean indicator for whether the current game user has ONLY limited visibility for this Entity.

type :string

Source:

A convenience reference to the item type (data.type) of this Item

Type:
  • string

uuid

Source:

Methods

(static) createOwned(itemData, actor)

Source:

A convenience constructor method to create an Item instance which is owned by an Actor

Parameters:
Name Type Description
itemData Object
actor Actor

hasPerm() → {Boolean}

Source:

Override the standard permission test for Item entities as we need to apply a special check for owned items OwnedItems have permission that the player has for the parent Actor.

Returns:

Whether or not the user has the permission for this item

Type
Boolean

(async) update(data, options) → {Promise}

Source:

Extend the base Entity update logic to update owned items as well. See Entity.update for more complete API documentation

Parameters:
Name Type Description
data Object

The data with which to update the entity

options Object

Additional options which customize the update workflow

Returns:

A Promise which resolves to the updated Entity

Type
Promise