1. Wiki
  2. /Entities
  3. /minecraft:economy_trade_table

minecraft:economy_trade_table

Don't want to write this by hand? GodCraft sets minecraft:economy_trade_table for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
convert_trades_economyBoolean"false"When the mob transforms, rebuilds its trades from the new table while keeping matching trades the same.
cured_discountRange [a, b]"[-25, -20]"Price discount given after a player cures this zombie villager.
display_nameStringnoneName shown at the top of the trade screen.
hero_demand_discountInteger"-4"How much Hero of the Village lowers demand in the old price formula.
max_cured_discountRange [a, b]"[-25, -20]"The biggest discount possible from curing this zombie villager.
max_nearby_cured_discountInteger"-200"The biggest discount from curing a nearby zombie villager, old formula only.
nearby_cured_discountInteger"-20"Price discount after a player cures a zombie villager nearby.
new_screenBoolean"false"Uses the newer trading screen.
persist_tradesBoolean"false"Keeps the same trades after the mob transforms into another trader.
show_trade_screenBoolean"true"Opens the trade screen when a player interacts with the mob.
tableStringnonePath to the trade table file in your pack.
use_legacy_price_formulaBoolean"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"
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more