1. Wiki
  2. /Entities
  3. /minecraft:behavior.trade_interest

minecraft:behavior.trade_interest

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

Overview

minecraft:behavior.trade_interest is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes a trader look at a player who holds an item it wants and show what it would give in return.

Fields

FieldTypeDefaultDescription
within_radiusnumber0How close the player must be for the trader to notice the item.
interest_timenumber45Longest time, in seconds, the trader keeps showing its trade items.
remove_item_timenumber1Longest time, in seconds, the trader waits after you stop holding a tradable item.
carried_item_switch_timenumber2Longest time, in seconds, the trader shows one item before switching to another that fits the same trade.
cooldownnumber2Seconds before the trader can use this goal again.
priorityinteger0Decides which goal wins when several want to run: lower numbers run first.Range: 0 to …
control_flagsGoal's control flags[]noneLists the body parts this goal takes control of (such as move, look or jump), so goals that need the same part don't run together.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:behavior.trade_interest": {
    "within_radius": 0,
    "interest_time": 45,
    "remove_item_time": 1,
    "carried_item_switch_time": 2,
    "cooldown": 2,
    "priority": 0,
    "control_flags": []
  }
}

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