minecraft:economy_trade_table for you with a switch.Get GodCraftOverview
minecraft:economy_trade_table is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets players trade with the entity using a trade table where prices change with demand, like villager trades. Point it to a trade file in your pack.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
convert_trades_economy | Boolean | "false" | When the mob transforms, rebuilds its trades from the new table while keeping matching trades the same. |
cured_discount | Range [a, b] | "[-25, -20]" | Price discount given after a player cures this zombie villager. |
display_name | String | none | Name shown at the top of the trade screen. |
hero_demand_discount | Integer | "-4" | How much Hero of the Village lowers demand in the old price formula. |
max_cured_discount | Range [a, b] | "[-25, -20]" | The biggest discount possible from curing this zombie villager. |
max_nearby_cured_discount | Integer | "-200" | The biggest discount from curing a nearby zombie villager, old formula only. |
nearby_cured_discount | Integer | "-20" | Price discount after a player cures a zombie villager nearby. |
new_screen | Boolean | "false" | Uses the newer trading screen. |
persist_trades | Boolean | "false" | Keeps the same trades after the mob transforms into another trader. |
show_trade_screen | Boolean | "true" | Opens the trade screen when a player interacts with the mob. |
table | String | none | Path to the trade table file in your pack. |
use_legacy_price_formula | Boolean | "false" | Uses the older way of working out prices. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:economy_trade_table": {
"convert_trades_economy": "false",
"cured_discount": "[-25, -20]",
"display_name": "",
"hero_demand_discount": "-4",
"max_cured_discount": "[-25, -20]",
"max_nearby_cured_discount": "-200",
"nearby_cured_discount": "-20",
"new_screen": "false"
}
}