minecraft:behavior.snacking for you with a switch.Get GodCraftOverview
minecraft:behavior.snacking is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets the mob stop and eat food items it is holding or finds nearby, like a panda munching bamboo.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
items | Item Descriptor[] | none | Which items the mob likes to snack on. |
snacking_cooldown | number | 7.5 | Seconds the mob waits before it can snack again. |
snacking_cooldown_min | number | 0.5 | Shortest wait, in seconds, before the mob can snack again. |
snacking_stop_chance | number | 0.00166667 | Chance from 0 to 1 that the mob stops snacking. |
priority | integer | 0 | Decides which goal wins when several want to run: lower numbers run first.Range: 0 to … |
control_flags | Goal's control flags[] | none | Lists 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.snacking": {
"items": [],
"snacking_cooldown": 7.5,
"snacking_cooldown_min": 0.5,
"snacking_stop_chance": 0.00166667,
"priority": 0,
"control_flags": []
}
}