minecraft:trade_table
Defines this entity's ability to trade with players.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
display_name | Text | "" | Name to be displayed while trading with this entity. |
table | Text | "" | File path relative to the behavior pack root for this entity's trades. |
new_screen | Boolean | false | Used to determine if trading with entity opens the new trade screen. |
persist_trades | Boolean | false | Determines if the trades should persist when the mob transforms. This makes it so that the next time the mob is transformed to something with a trade_table or economy_trade_table, then it keeps their trades. |
convert_trades_economy | Boolean | false | Determines when the mob transforms, if the trades should be converted when the new mob has a economy_trade_table. When the trades are converted, the mob will generate a new trade list with their new trade table, but then it will try to convert any of the same trades over to have the same enchantments and user data. For example, if the original has a Emerald to Enchanted Iron Sword (Sharpness 1), and the new trade also has an Emerald for Enchanted Iron Sword, then the enchantment will be Sharpness 1. |
Example from the game files
This is how vanilla Villager uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:trade_table": {
"convert_trades_economy": true,
"display_name": "entity.villager.cartographer",
"table": "trading/cartographer_trades.json"
}
}Used by 1
Vanilla entities with minecraft:trade_table in their definition:
Related components
physicscollision_boxtype_familyconditional_bandwidth_optimizationnameableis_hidden_when_invisiblepushable_by_blockpushable_by_entitylootcan_climbis_babyballoonableambient_sound_intervalvariantpushablepersistentis_tameddimension_boundis_saddledinput_ground_controlledis_shakingmark_variantrenders_when_invisiblecan_fly