Initial data from which to construct the Item
Optionalcontext: ConstructionContextConstruction context options
A Collection of ItemActions.
An object containing links to other items.
Static InternalsystemA static object holding system-specific metadata applicable to all instances of this Document class.
The item's material addons.
The item's alignment attributes, or null if the item has no alignment attributes
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.
Return attack sources for default action.
Array of value and label pairs for attack bonus sources on the main attack.
Consumes are adds charges by default.
Base material
Can equip currently?
Is this item usable at base level, disregarding per-action details.
Remaining charges
Linked ammunition item if any.
The default spell school of this items aura, if any
AbstracteffectEffective caster level of this item.
{@inheritDoc ItemPF.hasActions:getter}
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.
Finite charges
Is this item inside a container?
Is the item is fully functional.
This returns composite result of if the item is equipped, has quantity, is not disabled, is not out of charges, etc. and is not representative if the item can be set active or not via setActive.
Broken state
Tests both explicit broken override and current health.
AbstractisThe keys of data variables to memorize between updates, for e.g. determining the difference in update.
The item's actual material.
InternalRoot item.
Specifically the item at bottom of the container tree.
Should the item show unidentified data
The item's subtype, or null if the item has no subtype
A Universally Unique Identifier (uuid) for this Document instance.
StatichasStatichasStaticisInternal ExperimentalReturn active state change from data if present
This is a hack to allow item-type agnostic active state change detection.
InternalAdd item type specific roll data.
Roll data
InternalTest if specified link can be created.
The type of link.
The target item to link to.
Optionaloptions: object = {}Additional options
Whether a link to the item is possible here.
Configure item before data preparation.
Data model options
InternalThe type of link.
The target item to link to.
The link identifier for the item.
An array to insert into this item's link data.
Creation data
Context
Triggering user ID
InternalContext
Triggering user ID
Changed data
Context
Triggering user ID
InternalPrepare actions
InternalPrepare and update Changes collection.
Prepare data potentially dependent on other items.
This should be run at in Item.prepareDerivedData() if no actor is present, or in actor's prepareDerivedData after document preparation is done.
Is this final call to this?
InternalInitialize identifier
InternalPrepare ItemPF.scriptCalls collection.
InternalInternalChanged data
Context
Triggering user
InternalSystem data
InternalRecharges item's uses, if any.
Options
Exact time period only
Optionalperiod?: stringRecharge only if matching this time period
OptionalrollData?: objectRoll data
InternalRecharges item's uses, if any.
Options
Optionalexact?: booleanMatch only exact time period
Optionalmaximize?: booleanMaximize instead of using recharge formula
Optionalperiod?: stringRecharge only if it matches this time period
OptionalrollData?: objectRoll data instance
Optionalvalue?: numberSet charges to specific value
Reset charges when quantity is changed to simulate a stack.
Changed data
InternalAdjust HP value by item size.
In reference to rules established at Table 7-12 of CRB p. 175
InternalTransform given data so it becomes valid update data within parent item.
This can, for example, be used to generate batched update to the real item.
Update data
Optionaloptions: { recursive?: boolean } = {}Additional options
Optionalrecursive?: booleanCreate data recursively, meant for the real item document.
InternalUpdate this item's charges based on provided item.
Charge source
InternalUpdate max uses
Protected_Protected InternalUpdates protections and weaknesses with processed formulas.
Called in ()
Generic charge addition (or subtraction) function that either adds charges or quantity, based on item data.
The amount of charges to add.
Updated document or undefined if no update is possible.
Sets a boolean flag on this item.
The name/key of the flag to set.
Update context
Whether something was changed.
Adjust data if the item is in container.
Creates a link to another item.
The type of link.
The target item to link into this.
OptionalextraData: objectAdditional data to store int he link
Optionaloptions: object = {}Additional options
Display the chat card for an Item as a message in chat
OptionalmessageData: object = {}Optional data that will be merged into the message data.
Optionaloptions: { token?: TokenDocument } = {}Additional options.
Optionaltoken?: TokenDocumentRelevant 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.
OptionalextraParams: Record<string, any> = {}A dictionary of extra parameters to pass as variables for use in the script.
Optionalshared: object = {}Shared data object
The shared object between calls which may have been given data.
Get all items linked by any means.
Attack sources for a specific action.
Action ID
Optionaloptions: { rollData?: object } = {}Additional options
OptionalrollData?: objectRoll data instance
Array of value and label pairs for attack bonus sources on the main attack, or undefined if the action is missing.
Generates lists of change targets this item can have.
The target key, as defined in PF1.buffTargets.
A list of changes
Generates ChatData for this item, either in a default configuration or for a specific action.
Optionaloptions: {Options affecting how descriptions are enriched.
rollData
OptionalactionId?: stringThe ID of an action on this item to generate chat data for, defaults to ItemPF.defaultAction
Optionalchatcard?: booleanIs this actually for chat card.
Optionalextended?: booleanInclude extended information that may not be useful in all circumstances.
Optionalinteractive?: booleanOptionalrollData?: objectDefaults to ItemAction#getRollData/ItemPF#getRollData.
The chat data for this item (+action)
AbstractgetItem specific conditional sub targets.
Result key to label mapping.
AbstractgetItem specific conditional targets.
Key to target mapping.
Finds, filters and alters changes relevant to a context, and returns the result (as an array)
The given context.
Return cost multiplier affecting this item.
Such as item size dictating how costly an armor is.
Get default charge cost for all actions.
Optionaloptions: { rollData?: object } = {}Additional options
OptionalrollData?: objectRoll data instance
Number for default cost.
Default charge formula.
Charge formula
AbstractgetGet full description.
Item type dependant options for rendering the description.
Optionalbody?: booleanInclude main description body if such exists.
Optionalchatcard?: booleanInstruct template to render chat card in mind.
Optionaldata?: objectTemplate data for rendering
Optionalheader?: booleanInclude header if such exists.
Optionalidentified?: booleanEnforce identified description retrieval
Optionalisolated?: booleanPassed to getDescriptionData
OptionalrollData?: objectRoll data for transforming description
Description Data
Required to be async due to spell associated class map building.
Additional options
OptionalactionId?: stringID of an action. Default action is used if undefined.
Optionalisolated?: booleanInclude extra data to reflect it not being so easily available in context.
OptionalrollData?: objectRoll data instance
For supporting actions and changes in fromUuid()
Synced with Foundry v12.331
Get all item boolean flags as array.
The name/key of the flag to get.
The value stored in the flag.
Get all item dictionary flags as array of objects.
Returns labels for this item
Additional options
This item's labels
Get item links of type
Link type
Include link data, return value changes from item array to object array
Optionaloptions: { _results?: Set<any>; recursive?: boolean } = {}Additional options
Optional_results?: Set<any>Internal use only.
Optionalrecursive?: booleanRetrieved linked items recursively.
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"
Optionaloptions: { _results?: Set<string>; recursive?: boolean } = {}Additional options
Optional_results?: Set<string>Internal use only
Optionalrecursive?: booleanRetrieve links recursively.
Linked items or their compendium index data
Item name
If true, return value players see.
AbstractgetDetermines the starting data for an ActiveEffect based off this item.
Additional options
Roll data
Optionaloptions: objectAdditional options
An object with data to be used in rolls in relation to this item.
InternalFetches all this item's script calls of a specified category
Category
Returns the displayed value of an item according to multiple options
Optionaloptions: {Various optional parameters affecting value calculations
OptionalforceUnidentified?: booleanOverride whether the value should use the unidentified price
Optionalidentical?: booleanTreat all items in stack as identical (same number of charges).
OptionalinLowestDenomination?: booleanWhether the value should be returned in the lowest denomination
Optionalmaximized?: booleanPretend as if the items were fresh (full charges)
Optionalrecursive?: booleanWhether the value of contained items should be included
OptionalsellValue?: numberThe sell value multiplier
Optionalsingle?: booleanReturn value of singular item instead of the actual stack. Disables recursive option.
The item's value
Return weight multiplier affecting this item.
Such as item size dictating how heavy an armor is.
The name/key of the flag on this item.
Whether the flag was found on this item.
InternalMemorize quantity and level for later diffing.
InternalPrepare hardness and hit points
InternalPrepare item links.
Prepare this item's WeightData
Optionalinitialize: boolean = trueInitialize. Only used by containers.
Recharges item's uses, if any.
Options
Optionalcommit?: booleanCommit update directly. If false, returns the update data instead.
Optionalcontext?: objectUpdate context
Optionalexact?: booleanUse exact time period. Otherwise "week" for example will also recharge items with "day" period.
Optionalmaximize?: booleanRecharge to full regardless of recharge formula.
Optionalperiod?: "round" | "minute" | "hour" | "day" | "week" | "any"Recharge period. Use "any" to ignore item's configuration.
OptionalrollData?: objectRoll data instance to use for formulas.
Optionalvalue?: numberRecharge to specific value, respecting maximum and minimum bounds.
Removes a boolean flag from this item.
The name/key of the flag to remove.
Update context
Whether something was changed.
Removes a dictionary flag from this item.
The name/key of the flag to remove.
Update context
Whether something was changed.
Removes all link references to an item.
The UUID of the item to remove links to.
Optionaloptions: { commit?: boolean } = {}Additional options
Optionalcommit?: booleanCommit changes to database. If false, resulting update data is returned instead.
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.
Update data
Context
Use an attack, using SharedActionData
Options
OptionalactionId?: stringThe ID of the action to use, defaults to the first action
OptionalchatMessage?: booleanWhether to send a chat message for this action
Optionalcost?: numberCost override. Replaces charge cost or slot cost as appropriate.
Optionaldice?: stringThe base dice to roll for this action
Optionalev?: null | EventThe event that triggered the use, if any
Optionaloptions?: UseOptionsAdditional use options.
OptionalrollMode?: stringThe roll mode to use for the chat message
OptionalskipDialog?: booleanWhether to skip the dialog for this action
Optionaltoken?: TokenDocumentToken this action is for, if any.
Protected Static Abstract_ProtectedAdjust temporary item before creation
Optionalitem: ItemPFTemporary document
Optionaldata: objectCreation data
Optionaloverride: boolean = falseOverride values even if defined
Static_InternalCollect information on supplemental items and create them
Array of items to draw supplemental data from
Owner
Static_InternalDetermine whether a given change set affects size
Item data
Static_InternalDetermine whether a given change set affect senses
An object containing changeFlags and changes to be inspected.
Static_On-Create Operation
Post-create processing so awaiting the original operation has all secondary updates completed when it returns.
Documents
Operations and context data
Triggering user
Static_On-Delete Operation
Post-delete processing so awaiting the original operation has all secondary updates completed when it returns.
Documents
Operations and context data
Triggering user
Static_On-Update Operation
Post-update processing so awaiting the original operation has all secondary updates completed when it returns.
Documents
Operations and context data
Triggering user
StaticcreateItem create dialog.
Initial item data
Synchronized with Foundry VTT v13.347
StaticdefaultOverride to provide naming by subType potential.
Context where the name would be used
Optionalpack?: null | stringPack this would be within
Optionalparent?: null | DocumentParent document
OptionalsubType?: stringDocument subtype. Nonstandard option.
Optionaltype?: stringType
Synced with Foundry v12.331
StaticgetInternalAdd default artwork.
OptionalitemData: objectItem data
Loot item
Ammunition, gear, trade goods, etc.