Initial data from which to construct the Item
Optional
context: ConstructionContextConstruction context options
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.
Abstract
activeThe 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
Abstract
canIs this item usable at base level, disregarding per-action details.
Remaining charges
Linked ammunition item if any.
Abstract
effectEffective 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.
Abstract
isThe keys of data variables to memorize between updates, for e.g. determining the difference in update.
The item's actual material.
Internal
Root 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.
Static
hasStatic
hasStatic
isInternal
Experimental
Return active state change from data if present
This is a hack to allow item-type agnostic active state change detection.
Internal
Add item type specific roll data.
Roll data
Internal
Test if specified link can be created.
The type of link.
The target item to link to.
Optional
options: object = {}Additional options
Whether a link to the item is possible here.
Configure item before data preparation.
Data model options
Internal
The 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
Creation context options
Triggering user ID
Internal
Context
Triggering user ID
Changed data
Context
Triggering user ID
Internal
Prepare actions
Internal
Prepare 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?
Internal
Initialize identifier
Internal
Prepare ItemPF.scriptCalls
collection.
Internal
Internal
Changed data
Context
Triggering user
Abstract
_Internal
Fake DataModel-like behaviour
Ensure numeric bits remain numbers
System data
Internal
Recharges item's uses, if any.
Options
Exact time period only
Optional
period?: stringRecharge only if matching this time period
Optional
rollData?: objectRoll data
Internal
Recharges item's uses, if any.
Options
Optional
exact?: booleanMatch only exact time period
Optional
maximize?: booleanMaximize instead of using recharge formula
Optional
period?: stringRecharge only if it matches this time period
Optional
rollData?: objectRoll data instance
Optional
value?: numberSet charges to specific value
Internal
Transform 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
Optional
options: { recursive?: boolean } = {}Additional options
Optional
recursive?: booleanCreate data recursively, meant for the real item document.
Internal
Update this item's charges based on provided item.
Charge source
Internal
Update max uses
Protected
_Protected
Internal
Updates 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.
Abstract
adjustAdjust data if the item is in container.
Creates a link to another item.
The type of link.
The target item to link into this.
Optional
extraData: objectAdditional data to store int he link
Optional
options: object = {}Additional options
Display the chat card for an Item as a message in chat
Optional
messageData: object = {}Optional data that will be merged into the message data.
Optional
options: { token?: TokenDocument } = {}Additional options.
Optional
token?: 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.
Optional
extraParams: Record<string, any> = {}A dictionary of extra parameters to pass as variables for use in the script.
Optional
shared: 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
Optional
options: { rollData?: object } = {}Additional options
Optional
rollData?: 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
Abstract
getItem specific conditional sub targets.
Result key to label mapping.
Abstract
getItem 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.
Get default charge cost for all actions.
Optional
options: { rollData?: object } = {}Additional options
Optional
rollData?: objectRoll data instance
Number for default cost.
Default charge formula.
Charge formula
Get full description.
Item type dependant options for rendering the description.
Description Data
Required to be async due to spell associated class map building.
Additional options
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
Optional
options: { _results?: Set<any>; recursive?: boolean } = {}Additional options
Optional
_results?: Set<any>Internal use only.
Optional
recursive?: 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"
Optional
options: { _results?: Set<string>; recursive?: boolean } = {}Additional options
Optional
_results?: Set<string>Internal use only
Optional
recursive?: booleanRetrieve links recursively.
Linked items or their compendium index data
Item name
Optional
forcePlayerPerspective: boolean = falseIf true, return value players see.
Abstract
getDetermines the starting data for an ActiveEffect based off this item.
Additional options
Roll data
Optional
options: objectAdditional options
An object with data to be used in rolls in relation to this item.
Internal
Fetches all this item's script calls of a specified category
Category
The name/key of the flag on this item.
Whether the flag was found on this item.
Internal
Memorize quantity and level for later diffing.
Internal
Prepare item links.
Recharges item's uses, if any.
Options
Optional
commit?: booleanCommit update directly. If false, returns the update data instead.
Optional
context?: objectUpdate context
Optional
exact?: booleanUse exact time period. Otherwise "week" for example will also recharge items with "day" period.
Optional
maximize?: booleanRecharge to full regardless of recharge formula.
Optional
period?: "round" | "minute" | "hour" | "day" | "week" | "any"Recharge period. Use "any" to ignore item's configuration.
Optional
rollData?: objectRoll data instance to use for formulas.
Optional
value?: 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.
Optional
options: { commit?: boolean } = {}Additional options
Optional
commit?: 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
Optional
actionId?: stringThe ID of the action to use, defaults to the first action
Optional
chatMessage?: booleanWhether to send a chat message for this action
Optional
cost?: numberCost override. Replaces charge cost or slot cost as appropriate.
Optional
dice?: stringThe base dice to roll for this action
Optional
ev?: null | EventThe event that triggered the use, if any
Optional
options?: UseOptionsAdditional use options.
Optional
rollMode?: stringThe roll mode to use for the chat message
Optional
skipDialog?: booleanWhether to skip the dialog for this action
Optional
token?: TokenDocumentToken this action is for, if any.
Protected
Static
Abstract
_Protected
Adjust temporary item before creation
Optional
item: ItemPFTemporary document
Optional
data: objectCreation data
Optional
override: boolean = falseOverride values even if defined
Static
_Internal
Collect information on supplemental items and create them
Array of items to draw supplemental data from
Owner
Static
_Internal
Determine whether a given change set affects size
Item data
Static
_Internal
Determine 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
Static
createItem create dialog.
Initial item data
Synchronized with Foundry VTT v13.347
Static
defaultOverride to provide naming by subType potential.
Context where the name would be used
Optional
pack?: null | stringPack this would be within
Optional
parent?: null | DocumentParent document
Optional
subType?: stringDocument subtype. Nonstandard option.
Optional
type?: stringType
Synced with Foundry v12.331
Static
getInternal
Add default artwork.
Optional
itemData: objectItem data
Feature item
Class features, feats, traits, templates, racial traits, etc.