Open Trade Machine
Open an ItemsAdder trade_machine or block_trade_machine GUI from an action.
open_trade_machine opens the ItemsAdder trade machine GUI for the target player without requiring the machine block or furniture to be placed in the world.
Use it for menu items, NPC interaction flows, custom stations, or any other action trigger that should open a specific ItemsAdder trade machine.
Requirements
- The target must be a player. Non-player targets are skipped.
- The referenced ItemsAdder content must have a
trade_machineorblock_trade_machinebehaviour.
Configuration
info:
namespace: stations
items:
alchemy_token:
display_name: "<green>Alchemy Station"
events:
interact:
right:
open_trade_machine:
trade_machine: stations:alchemy_tableOptions
| Key | Type | Required | Description |
|---|---|---|---|
trade_machine | string | yes | ItemsAdder item, block, or furniture ID that provides a trade machine GUI. Bare IDs are supported. See IDs. |
With targeting
The action uses the shared action parameters. For example, this opens the GUI for the entity the player is looking at if that target is a player:
open_trade_machine:
trade_machine: stations:alchemy_table
target: in_sight
target_in_sight_distance: 8Plugin config
This action can be disabled in config.yml:
actions:
open_trade_machine: falseThe key is optional. Missing action toggle keys default to enabled.
Reload behavior
Run /iareload after editing the ItemsAdder content YAML. The referenced trade machine must already be registered by ItemsAdder.
Common mistakes
- Using an ID for a normal item that does not have a
trade_machineorblock_trade_machinebehaviour. - Running the action against
target: otherwhen the event target is not a player. - Reusing the same bare ID for multiple trade machines in different packs.