mojira.dev
MC-3151

New Mob AI doesn't take world limit/Void into account for pathing

The previous mob AI prevented mobs from pathing across the bottom most plane of the map, the Void. The new mob AI does not take this into account and appears to treat the boundary between the bottom of the world and the Void as a solid plane which can be pathed across. It appears this is caused by the way which pathing is done. As there is nothing to detect below the point separating the world from the Void, the pathing checks to this point and assumes a solid surface exists, thus instructing mobs to attempt crossing and deleting themselves upon contact.

While normally this situation may not occur, maps which utilize the Void as a deterrent of the player must prevent mob access to areas low over the Void. Even at a height above the Void, mobs will conduct the normal calculations for dropping onto solid surfaces and attempt dropping onto the Void. Especially in this case, map makers attach large amounts of custom data to mobs, so the possibility of the mobs essentially deleting themselves is a frustrating thought.

Simplest way to test this: Create a superflat map and dig a 3x3 hole to the Void, leaving the center Bedrock block above it. Spawn a sheep or other mob on the Bedrock, then utilize anything which would normally cause the mob to move. It will walk off and be deleted upon contact with the Void, despite that there is no surface for it to walk on other than the non-collidable boundary..

Original Report: Before Jon's new AI, mobs would avoid wandering into the Void. The new AI does not take into account if the path they are taking is over open Void. It appears that currently Mob AI only takes into account the number of air blocks to fall, and since this can not be counted below the world limit, the AI essentially treats the Void as a solid floor. This means that if the Void is only a few blocks lower than the surface a mob is walking on, the mob will freely wander into the Void and die.

This can be tested by placing a block over open void and spawning a mob on it. The mob will normally simply walk off. This can also be tested by exploiting Villager's more predictable AI mechanics. First, create a classic Superflat world. Make a simple home underground with a door. Then place villagers inside. Break the bedrock directly in front of the door, and you will witness villagers freely wandering into the Void through the hole.

This should be easy enough to resolve - it has just gone widely unnoticed for quite some time.

Edit: Considering Jeb's declaration that all mobs will now use the new AI (https://twitter.com/jeb_/status/428840815549747200), I wish this issue reconsidered. Read comment below (Jan 30, 2014).

Linked issues

Comments 16

Do not set affected version to future versions, you couldn't have played it!

This site is for bug reports only. For feature suggestions/changes please use the MineCraft Forums: Suggestions.

@Kumasasa - why does it let you select future versions?

I noticed several resolved issues under 1.5, which was what confused me. I won't put these in 1.5's entry again, sorry.

In terms of this ticket, this is definitely an oversight with the new AI code. The previous AI code prevented mobs from wandering into the Void. When the new AI code was introduced, I tested and compared how mobs acted when on a single block above the Void. In the previous AI code they would stand still, even when presented wheat. When I loaded the same world in the new version, before my world even finished loading, the mob would simply walk off the platform. Before making this ticket, I tested this in 1.4.4 and found it to be even worse. Since they added the mechanic of mobs calculating risk in falling, I noticed villagers jumping in from greater height. Falling in from a greater height isn't a constant, but mobs will still freely wander into the Void.

This is either a bug, or Working as Intended, but certainly not a feature request. It is inconsistent and unexpected behavior. It previously did not occur, but now does as a result of a code change.

6 more comments

Well, I've always doubted they intended for mobs to walk into the Void. I mean maybe there's a reason, but I think it was just a forgotten part of the code which ends up causing mobs full of mapmaker NBT to commit suicide and be a frustration to recreate. At least that's how I see it'd be an issue in modern Minecraft: All the mapmaker ability on entities, and mobs can just walk off and be deleted on contact.

It doesn't matter if you doubt it. You need to either bring the issue up directly with the developers, or prove to the moderators that it's not intended. The easiest way to accomplish the second would be the first. They're not going to reopen the issue just because you ask.

Reopened.
Unclear if oversight or intended or working by design.

Thank you. Of course if it becomes agreed to be intended, I'll accept it being closed again. I am only concerned, as said, 1: Because all mobs now utilize the new AI to varying extents. 2: With all the data attached to mobs, mostly with custom maps, I'd consider mobs deleting themselves an issue. 3: They can't walk on the Void, so I find it odd they'd path over it.

Fix by @unknown of MC-5397:

Possible fix
Using MCP naming.

PathFinder.getSafePoint()

...
        if (var9++ >= entity.func_82143_as()) {
            return null;
        }

        --y;

        if (y > 0) {
            var7 = this.openPoint(x, y, z); // Accept a point in mid air, eh?
        } else {         // FIX: lets cancel that possible mid air point if reached void.
            return null; // FIX
        }                // FIX
    ...

Tested on 1.4.7 and at least creepers learned to look down.

megascience

Nathan Adams

Community Consensus

AI, fall, mob, void

Minecraft 1.4.4, Snapshot 13w04a, Minecraft 14w04b, Minecraft 14w05a, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 14w10b

Minecraft 14w10c

Retrieved