The Bug
Goats, when on an area consisting of not full blocks (soul sand, mud, honey, path blocks, farmland, etc.) Will not attack entities. Additionally, if the entity is not placed on a full block (such as placing an armor stand on a path block), the goats will not ram it.
Reproduce
Make a room filled with a non full block like Soul Sand
Summon a goat
Go into survival
Do
/execute as @e[type=minecraft:goat,limit=1,sort=nearest] run data modify entity @s Brain.memories."minecraft:ram_cooldown_ticks".value set value 1
Observed Result
The Goat never rammed
Expected Result
The Goat would ram
Code analysis (Mojang mappings, 1.19.4-rc2): The ramming start is controlled by the
PrepareRamNearestTarget
behavior, which chooses a ram target position by picking the block position of the nearest targetable living entity, and then calculating the ram start position.PrepareRamNearestTarget#calculateRammingStartPosition
will not return a block position if the block underneath the targeted ram position is not a walkable block. Not only that, it checks if every single block the goat will have to pathfind through is a walkable block:A walkable block has to be a stable destination, which in
PathNavigation#isStableDestination(BlockPos)
, checks if there is a solid, full block underneath:I believe that at least using
isFaceSturdy(this.level, $$1, Direction.UP)
instead ofisSolidRender(this.level, $$1)
would allow goats to ram on top of top slabs, glass blocks and slime blocks, which they currently don't do, while not breaking anything. However, they still wouldn't be ram on, for example, bottom slabs, enchanting tables or walls. Ideally, the behavior should useisPathfindable(...)
instead, but that could break something.