minecraft:behavior.trade_interest
Allows the mob to look at a player that is holding a tradable item.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
within_radius | Decimal | 0 | Distance in blocks this mob can be interested by a player holding an item they like |
interest_time | Decimal | 45 | The max time in seconds that the trader will be interested with showing its trade items |
remove_item_time | Decimal | 1 | The max time in seconds that the trader will wait when you no longer have items to trade |
carried_item_switch_time | Decimal | 2 | The max time in seconds that the trader will hold an item before attempting to switch for a different item that takes the same trade |
cooldown | Decimal | 2 | The time in seconds before the trader can use this goal again |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Villager uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.trade_interest": {
"carried_item_switch_time": 2,
"cooldown": 2,
"interest_time": 45,
"within_radius": 6,
"priority": 5,
"remove_item_time": 1
}
}Used by 2
Vanilla entities with minecraft:behavior.trade_interest in their definition:
Related components
behavior.look_at_playerbehavior.temptbehavior.breedbehavior.mount_pathingbehavior.follow_parentbehavior.player_ride_tamedbehavior.find_mountbehavior.celebratebehavior.follow_ownerbehavior.stay_while_sittingbehavior.look_at_trading_playerbehavior.random_look_around_and_sitbehavior.take_flowerbehavior.trade_with_playerbehavior.celebrate_survivebehavior.controlled_by_playerbehavior.follow_caravanbehavior.follow_mobbehavior.make_lovebehavior.ocelot_sit_on_blockbehavior.playbehavior.receive_lovebehavior.share_itemsbehavior.admire_item