minecraft:behavior.drop_item_for for you with a switch.Get GodCraftOverview
minecraft:behavior.drop_item_for is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that makes the mob walk up to a target and drop an item near it, like a cat leaving a gift for a sleeping player. Needs a navigation component.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
seconds_before_pickup | number | 0 | Seconds before the dropped item can be picked up.Range: 0 to … |
cooldown | number | 0.25 | Seconds to wait before the goal can run again.Range: 0 to … |
drop_item_chance | number | 1 | Chance that the mob actually drops an item. 1.0 means 100%.Range: 0 to 1 |
offering_distance | number | 1 | How far from the target the mob likes to stand when dropping.Range: 0 to … |
minimum_teleport_distance | number | 2 | If the target spot is farther than this, the mob teleports there.Range: 0 to … |
max_head_look_at_height | number | 10 | Highest point the mob looks up to while dropping the item.Range: 0 to … |
target_range | vec3 | [1,1,1] | Size of the box, in blocks, searched for a target. |
teleport_offset | vec3 | [0,1,0] | X, Y and Z shift added to the spot when the mob teleports. |
time_of_day_range | FloatRange | {"max":1,"min":0} | Times of day the goal can run. 0.0 is noon, 0.25 sunset, 0.5 midnight, 0.75 sunrise. |
loot_table | string | "" | Loot table that picks the dropped item. |
on_drop_attempt | ActorDefinitionTrigger | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | Event that fires when the mob tries to drop an item. |
entity_types | EntityTypes | none | Which entities can receive the item. |
search_range | integer | 0 | How far sideways, in blocks, the mob looks for a spot to go. |
search_height | integer | 1 | How far up and down, in blocks, the mob looks for a spot to go. |
goal_radius | number | 0.5 | How close the mob must get to count as arrived, which stops it jittering around the spot. |
search_count | integer | 0 | How many random blocks are checked each tick. 0 checks every block in range.Range: 0 to … |
speed_multiplier | number | 1 | Speed multiplier while moving to the target.Range: 0 to … |
priority | integer | 0 | Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to … |
control_flags | Goal's control flags[] | none | Which body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:behavior.drop_item_for": {
"seconds_before_pickup": 0,
"cooldown": 0.25,
"drop_item_chance": 1,
"offering_distance": 1,
"minimum_teleport_distance": 2,
"max_head_look_at_height": 10,
"target_range": [
1,
1,
1
],
"teleport_offset": [
0,
1,
0
]
}
}