minecraft:behavior.go_and_give_items_to_owner
The entity will attempt to toss the items from its inventory to its owner.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
run_speed | Decimal | 1 | Sets the entity's speed when running toward the owner. |
reach_mob_distance | Decimal | 3 | Sets the desired distance to be reached before giving items to owner. |
throw_force | Decimal | 0.2 | Sets the throw force. |
vertical_throw_mul | Decimal | 1.5 | Sets the vertical throw multiplier that is applied on top of the throw force in the vertical direction. |
throw_sound | Textitem.use.on, hit, step, step.baby, fly, jump, jump.prevent, break, place, heavy.step, gallop, fall, hurt, hurt.baby, hurt.in.water, death, death.baby, death.in.water, death.to.zombie, ambient, ambient.baby, ambient.in.water, ambient.in.air, ambient.tame … | "charge" | Sound to play when this mob throws an item. |
on_item_throw | List of object | [] | Event(s) to run when this mob throws items. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object or List of object | {"AND": null, "NOT": null, "OR": null, "all": null, "all_… | Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Allay uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.go_and_give_items_to_owner": {
"on_item_throw": [
{
"event": "pickup_item_delay",
"target": "self"
}
],
"priority": 4,
"run_speed": 8,
"throw_sound": "item_thrown"
}
}Used by 1
Vanilla entities with minecraft:behavior.go_and_give_items_to_owner in their definition: