Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-176799

preferred_path doesn't work properly with non-full blocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.20.50.24 Preview
    • None
    • Unconfirmed
    • Windows

      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

      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.

        1. image-2023-11-09-22-04-15-661.png
          544 kB
          [Mod] tryashtar
        2. Test World Beta.mcworld
          1.40 MB
          [Mod] tryashtar

            tryashtar [Mod] tryashtar
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: