minecraft:behavior.go_and_give_items_to_noteblock for you with a switch.Get GodCraftOverview
minecraft:behavior.go_and_give_items_to_noteblock 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 run to a note block that was just played and toss its items next to it, like an allay.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
run_speed | number | 1 | Speed while running to the note block. |
reach_block_distance | number | 3 | How close the mob gets before throwing the items. |
listen_time | integer | 30 | How long the mob keeps bringing items after hearing the note block. |
throw_force | number | 0.2 | How hard the items are thrown. |
vertical_throw_mul | number | 1.5 | Extra multiplier for the upward part of the throw. |
throw_sound | LevelSoundEvent | "charge" | Sound played when the mob throws an item. |
on_item_throw | ActorDefinitionTrigger[] | none | Events that fire when the mob throws items. |
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.go_and_give_items_to_noteblock": {
"run_speed": 1,
"reach_block_distance": 3,
"listen_time": 30,
"throw_force": 0.2,
"vertical_throw_mul": 1.5,
"throw_sound": "charge",
"on_item_throw": [],
"priority": 0
}
}