When attempting to make an entity eat a block (like how sheep eat grass), when the entity is eating a block, query.is_grazing should trigger allowing us to play a eating animation. This used to work in the past but now doesn't, even using ' "runtime_identifer": "minecraft:sheep" ' in the behavior file (though it shouldn't need it).
Steps To Reproduce:
Create an entity that eats blocks using the "minecraft:behavior.eat_block" component
Create an animation that only fires when the entity is grazing (use query.is_grazing)
Though the entity will eat the block, it will never play the animation
Expected Behavior:
query.is_grazing works for all mobs, not just the sheep
Actual Behavior:
query.is_grazing doesn't work for any mob that isn't a sheep
Comments 3
i have a better way to reproduce
make a addon for bedrock with a custom mob that has code
"minecraft:behavior.eat_block": { "priority": 6, "success_chance": "query.is_baby ? 0.02 : 0.001", "time_until_eat": 1.8, "eat_and_replace_block_pairs": [ { "eat_block": "grass", "replace_block": "dirt" }, { "eat_block": "tallgrass", "replace_block": "air" } ], "on_eat": { "event": "minecraft:on_eat_block", "target": "self" } },then make an animation defined by "grazing"
then add
"scripts": {
"animate": [
{"grazing":"query.is_grazing"}
]
},
4. run behavior pack
Works in 1.16.210.55