Optional alignmentOptional bindableOptional clientMarks this usable action as only executable client-side. This disables support for "auto-use" in action slots.
Optional displayThe contexts this action appears in.
Optional forceOptional historyWhether action history should remember the tile this action was used on
Optional iconThe icon this action should have, if any.
Optional iconWhere the icon should appear, when slotted with an item. Defaults to bottom right.
Generally, top left means "something else interacting with the slotted item" rather than "the slotted item interacting with something."
For example, "Harvest" shows in bottom right, because it's using this tool to harvest. Whereas "Repair With X" shows in top left,
because it's repairing this tool.
Optional idOptional inspectOptional interactionBy default, actions are assumed to be interacting with the tile in front of them. This recategorises the action as one that either is unrelated to the tile in front, or interacting with the tile below.
This affects where the game chooses to path the player to in order to use the action.
Optional noMarks this usable action as, when slotted in the action bar on an item, the item should be ignored and instead the type should be used. Compatible with noSlotQuality
Optional noMarks this usable action as, when slotted in the action bar on an item, the item & quality should be ignored. Compatible with noSlotItem
Optional priorityControls the display order of this action compared to other actions. Generally you want to leave this as 0 (default) and just register your action in the correct place. Priority can be generated dynamically based on the given objects — item, doodad, etc.
Higher priority === appears first.
Lower priority === appears last.
Optional requirementsThe display level of the action when there's an error with its requirements.
Optional slottableWhether this action can be slotted in the action bar. Defaults to true.
If set to an ActionId, the ActionId will be attempted to be slotted instead.
Optional targetWhether to target the tile the mouse is over by default.
Optional translateA handler for registering translations for the action's name, description, etc.
Optional using: IUsableActionPossibleUsingOptional useA hint for the inspection system that this UA is internally using a specific action. Use tooltip filtering checks this.
Optional executeExecutes this action. Generally, this is where you want to execute an internal action registered with @Register.action,
as internal actions are called on all sides, rather than only clientside*.
*Warning: While usable actions appear to only ever be client-side, they're not always. The "auto-use" feature for action slots results in actions being executed only on the server's side. If you try to perform a client-side UI function here, such as showing a prompt, and a player puts the action in a "auto-use" action slot, the host will receive the prompt instead!
If you'd like to execute some things on clientside, you can check if the player is the local player by checking if (player.asLocalPlayer),
or ensure that this action is only executed clientside by setting clientSide: true, which disables support for the "auto-use" feature.
The player executing this action. This isn't always the local player!
What the player is using — items, doodads, etc.
Context to do with this action execution — where it's executed from, etc.
Optional highlightA handler for what this action will highlight when hovered with the mouse.
The default selectors. The defaults can be removed, and/or additional selectors can be added.
What this action is using. Item, doodad, etc.
Optional inspectOptional isWhether this action is "applicable" given this player and these "provided" objects.
The player executing this action. This isn't always the local player!
What the player is using — items, doodads, etc.
Optional isWhether this action is currently usable — even if an action "makes sense" with the player and the objects they're using, and the player can slot it and stuff, it might not currently be usable. For example, "harvest" having nothing to harvest.
The player executing this action. This isn't always the local player!
What the player is using — items, doodads, etc.
Optional submenuMarks this "action" as a submenu container instead of an executable. Is a generator for the submenu.
The registrar that submenu actions should be appended to.
What this action is using. Item, doodad, etc.
Optional tooltipGenerated using TypeDoc
The bindable assigned to this action, for use in action context menus (ie, right clicking on the world or an item.) Allows for a dynamically generated bindable based on what this action is using — item, doodad, etc.