A Collection of ItemActions.
An object containing links to other items.
Static
Internal
systemA static object holding system-specific metadata applicable to all instances of this Document class.
Whether this item is a physical one, possessing properties like quantity or weight.
An array containing all action types from this item's actions.
Generic damage source retrieval for default action, includes default conditionals and other item specific modifiers.
All relevant changes, or undefined if action was not found.
Get default action's attack array.
Simple array describing the individual guaranteed attacks.
Return attack sources for default action.
Array of value and label pairs for attack bonus sources on the main attack.
Linked ammunition item if any.
An active effect associated with this item.
Returns true
if any of this item's actions have an attack, see ItemAction#hasAttack.
Returns true
if any of this item's actions have a damage roll, see ItemAction#hasDamage.
Whether this item is physical.
The keys of data variables to memorize between updates, for e.g. determining the difference in update.
Should the item show unidentified data
The item's subtype, or null
if the item has no subtype
Returns total duration in seconds or null.
Seconds or null.
Static
defaultStatic
isWhether this item is physical.
Private
_chargeThe type of link.
Either "compendium", "data" or "world".
The target item to link to.
The link identifier for the item.
Whether a link to the item is possible here.
Creates a link to another item.
The type of link. e.g. "children", "charges", "classAssociations" or "ammunition".
Either "compendium", "data" or "world".
The target item to link to.
The link identifier for the item. e.g. UUID for items external to the actor, and item ID for same actor items.
Whether a link was created.
Display the chat card for an Item as a message in chat
Optional
altChatData: object = {}Optional data that will be merged into the chat data object.
Optional
options: { Additional options.
Relevant token if any.
Chat message instance if one was created.
Executes all script calls on this item of a specified category.
The category of script calls to call.
Optional
extraParams: Object = {}A dictionary of extra parameters to pass as variables for use in the script.
The shared object between calls which may have been given data.
The type of link.
Either "compendium", "data" or "world".
The target item to link to.
The link identifier for the item.
An array to insert into this item's link data.
Generates ChatData for this item, either in a default configuration or for a specific action.
Optional
enrichOptions: any = {}Options affecting how descriptions are enriched.
rollData
defaults to ItemAction#getRollData/getRollData.
secrets
defaults to Item#isOwner.
Optional
options: { Additional options affecting the chat data generation
The ID of an action on this item to generate chat data for, defaults to firstAction
Is this actually for chat card.
The chat data for this item (+action)
Finds, filters and alters changes relevant to a context, and returns the result (as an array)
Optional
context: string = "attack"The given context. Either "mattack", "rattack", "wdamage", "sdamage".
The resulting changes.
Get full description.
Item type dependant options for rendering the description.
Instruct template to render chat card in mind.
Template data for rendering
Full description.
Returns labels for this item
Optional
options: { Additional options
ID of one of this item's actions to get labels for; defaults to first action
Roll data to use.
This item's labels
Retrieve item referred to by a link in .system.links data
Link data
Linked item, undefined, or compendium index data
const items = (item.system.links?.children ?? [])
.map(link => item.getLinkedItemSync(link));
Retrieve list of linked items for a type, synchronously. Intended mainly for fetching child or charge links quickly.
Link type, e.g. "children", "charges", or "classAssociations"
Linked items or their compendium index data
const childItems = item.getLinkedItemsSync("children");
Per item type chat data.
A partial of a chat data object that can be modified to add per item type data.
The labels for this item.
Additional property strings
A rollData object to be used for checks
Returns the displayed value of an item according to multiple options
Optional
options: { Various optional parameters affecting value calculations
Override whether the value should use the unidentified price
Whether the value should be returned in the lowest denomination
Whether the value of contained items should be included
The sell value multiplier
The item's value
Recharges item's uses, if any.
Options
Commit update directly. If false, returns the update data instead.
Update context
Use exact time period. Otherwise "week" for example will also recharge items with "day" period.
Recharge to full regardless of recharge formula.
Recharge period. Use "any" to ignore item's configuration.
Roll data instance to use for formulas.
Recharge to specific value, respecting maximum and minimum bounds.
Promise for the update, update data object, or undefined (no update needed).
Sets a dictionary flag value on this item.
The name/key of the flag to set.
The flag's new value.
Update context
Whether something was changed.
Use an attack, using SharedActionData
Optional
__namedParameters: string = {}Static
Private
_getStatic
_onStatic
_onStatic
Private
_onStatic
chatStatic
isDetermine whether an item type is physical.
The item type to check
Whether an item of that type is physical.
Use isPhysical insted.
Generated using TypeDoc
Override and extend the basic :class:
Item
implementation