Since when do zombies not walk over rails?



by WindMountains8

19 Comments

  1. PlumAcrobatic431 on

    The mobs have a unique pathfinding mechanic. It renders the rail as a block, so even if it technically *can* walk over it, its AI says it can’t. However, if there are multiple zombies or you make a zombie aggressive enough, they can walk over the rails via pushing.

  2. Since rails were added? They’re marked as impassible in the code. (no clue where, just looked it up on the wiki. I’d look for it but mob AI is such a spaghetti mess that I’d end up looking for an hour haha)

  3. entities see rails as a full block that they cant cross. its very useful and helps keep my mending villager in my house since i let it roam around my house

  4. PotatoesAndChill on

    Minecraft 1.5
    [https://minecraft.wiki/w/Rail#Java_Edition](https://minecraft.wiki/w/Rail#Java_Edition)

    Rails are treated as impassible blocks so mobs don’t spawn or walk on them. This is a QoL change to prevent railways being blocked by random mobs, but it also allows for such pathfinding exploits. You can surround a mob with rails to completely immobilise it without impeding yourself.

  5. When minecarts were first added there was an issue where minecarts would glitch upon coming into contact with mobs on the track, so the devs just added a pathfinding rule so that they could not walk on rails. This rule is still in the game today even though the bug has been fixed, meaning you can surround your house in rails to make a mob-proof barrier!

  6. Note that if the mob is already on a rail, it can continue walking on rails.

    But there is what I think is a bug in that this checks if the mob’s *starting* position is on a rail, not its *current* position.
    Meaning if it *started* on a rail, it will be able to walk through any rails within that pathfinding attempt, even if it got off the rail at some point.

    This happens after the hit knocks him onto the rail at 0:22.
    His starting position there is on a rail, and he was able to walk into the rail segment closer to you, even though there’s a non-rail in-between the two.

    This is in contrast to if the mob didn’t start on a rail, then they just can’t get through the rail.
    And even if the pathfinding got it on a rail (can still drop down onto them like dropping down onto a normal block), he will be able to get out of that rail segment, but still won’t be able to get through other rail segments once he gets off.