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.
AbstractactiveThe 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
Is this item usable at base level, disregarding per-action details.
Remaining charges
Linked ammunition item 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?
AbstractisIs 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.
Determine if this spell is domain/school spell.
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
Number of slots the spell takes to prepare.
Quick access to .system.slotCost with additional considerations such as at-will toggle.
Defaults to 1 if the data is not present, 0 if the spell is at-will.
Linked spellbook
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
Creation context options
Triggering user ID
Delete context options
Triggering user
Changed data
Context
Triggering user ID
InternalCreation data
Context options
Triggering user
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
Abstract_InternalFake DataModel-like behaviour
Ensure numeric bits remain numbers
System 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
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 ()
Add charges to the spell or its relevant resource pool (spell points or spontaneous spells).
Number of charges to add
Optionaldata: object = nullAdditional data to pass to the update
Updated document or undefined if no update is possible or required.
Sets a boolean flag on this item.
The name/key of the flag to set.
Update context
Whether something was changed.
AbstractadjustAdjust 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
Concentration DC
Type of concentration check. See pf1.registry.Concentration.
Optionaloptions: object = {}Additional options
AbstractgetItem specific conditional sub targets.
Result key to label mapping.
Item 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 spell actions.
Optionaloptions: { rollData?: object } = {}Additional options
OptionalrollData?: objectRoll data instance
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
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
OptionalforcePlayerPerspective: boolean = falseIf 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
Spell components
Additional options
Optionalcompact?: booleanRemove redundant components (e.g. M/DF becomes DF for divine caster)
Number of remaining uses, or max.
Return max uses.
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 item links.
Recharges item's uses, if any.
Options
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.
AbstractsetSet item's active state.
Active state
Optionalcontext: objectOptional update context
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.
Static_Adjust temporary item before creation
Temporary document
Creation data
Override 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
Static_InternalUsed in consumable creation
String to convert
Roll data instance
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
StaticgetGet the price of a consumable given the spell level and caster level.
Spell item data.
Consumable type.
StaticgetInternalAdd default artwork.
OptionalitemData: objectItem data
StaticgetA spell item's data.
StatictoConvert spell into a consumable item.
Spell item data
Consumable type
Optionaloptions: { spellType?: string } = {}Additional options
OptionalspellType?: stringSpell type
StatictoOpen Consumable conversion dialog.
Automatically calls this.toConsumable as appropriate.
Spell item data
Optionaloptions: { actor?: object; allowSpell?: boolean; spellType?: string } = {}Additional options
Optionalactor?: objectThe actor the consumable is being created on.
OptionalallowSpell?: booleanAllow spell creation
OptionalspellType?: stringSpell type
Spell item