mojira.dev
MCPE-176799

preferred_path doesn't work properly with non-full blocks

The bug

The preferred_path component can, in some vague undocumented way, make mobs "prefer" walking on specific blocks. If a block of less than full height is included in this component, it doesn't work as expected. The mob will not prefer to pathfind on those blocks.
 

How to reproduce

1. Download and open the attached world. It gives villagers the following component, which makes them unable to path on any block except for grass paths and diamond blocks.

"minecraft:preferred_path": {
  "default_block_cost": -1,
  "preferred_path_blocks": [
      {
        "cost": 0,
        "blocks": ["grass_path", "diamond_block"]
      }
  ]
}

2. Watch the villagers pathfind.

Expected result
Villagers pathfind equally well on grass paths and diamond blocks

Observed result
Villagers on grass paths are unable to pathfind

[media]

Notes

This affects vanilla villagers. They are programmed to prioritize grass paths above all other blocks, but due to this bug, they don't.

From simple testing, it's clear that the mobs are checking the block underneath the path instead of the path itself.

Related issues

Attachments

Comments

migrated
[media][media]
Hangekisobu

relates to MCPE-162250

GoldenHelmet

This is just a duplicate of MCPE-162250. Comments on that report already call out the component and how it has malfunctioned since the collision change to path blocks.

tryashtar

(Unassigned)

Unconfirmed

Windows

1.20.50.24 Preview

Retrieved