1. Wiki
  2. /Entities
  3. /minecraft:behavior.snacking

minecraft:behavior.snacking

Don't want to write this by hand? GodCraft sets minecraft:behavior.snacking for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
itemsItem Descriptor[]noneWhich items the mob likes to snack on.
snacking_cooldownnumber7.5Seconds the mob waits before it can snack again.
snacking_cooldown_minnumber0.5Shortest wait, in seconds, before the mob can snack again.
snacking_stop_chancenumber0.00166667Chance from 0 to 1 that the mob stops snacking.
priorityinteger0Decides which goal wins when several want to run: lower numbers run first.Range: 0 to …
control_flagsGoal's control flags[]noneLists 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": []
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more