minecraft:economy_trade_table
Defines this entity's ability to trade with players.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
display_name | Text | "" | The entity localization key used for the trading UI display name. |
table | Text | "" | Path to the trade table JSON that defines available offers. |
new_screen | Boolean | false | Whether this trader uses the newer trade screen implementation. |
hero_demand_discount | Integer | -4 | Additional demand discount applied while the player has Hero of the Village. |
cured_discount | Object | {"max": -20, "min": -25} | Range of cured villager discounts applied to trade prices. |
min | Integer | 0 | |
max | Integer | 0 | |
max_cured_discount | Object | {"max": -20, "min": -25} | Maximum allowed range for cured villager discounts. |
min | Integer | 0 | |
max | Integer | 0 | |
nearby_cured_discount | Integer | -20 | Nearby cured villager discount step applied by legacy pricing. |
max_nearby_cured_discount | Integer | -200 | Most negative nearby cured villager discount allowed by legacy pricing. |
persist_trades | Boolean | false | Whether generated offers are persisted with the actor save data. |
convert_trades_economy | Boolean | false | Whether legacy trade data is converted into economy trade data. |
show_trade_screen | Boolean | true | Whether interacting with this trader opens the trade screen. |
use_legacy_price_formula | Boolean | false | Whether legacy price calculations are used instead of the newer pricing formula. |
Example from the game files
This is how vanilla Villager uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:economy_trade_table": {
"cured_discount": [
-25,
-20
],
"display_name": "entity.villager.cartographer",
"max_cured_discount": [
-25,
-20
],
"new_screen": true,
"persist_trades": true,
"table": "trading/economy_trades/cartographer_trades.json"
}
}Used by 2
Vanilla entities with minecraft:economy_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