Talk:Java Edition 15w40a

Pathfinding
I dug into the pathfinding code a little bit. A position can have one of the following states: As far as logic goes, #1, #5, and #6 are "never go here" (weight -1); #2, #3, and #4 are "ok to go here" (weight 1); #7, #8, and #10 are "avoid this" (weight 8); and #9 and #11 are "really avoid this" (weight 16).
 * 1) Impassable.
 * 2) * Most blocks made from a movement-blocking material. Exceptions are banners, signs, open fence gates, and pressure plates (and trapdoors and wooden doors, those are described separately below).
 * 3) * Walls, fences.
 * 4) * Snow layers stacked 5 or more deep (but the mob might jump on it).
 * 5) * Any wooden door for villagers at night.
 * 6) * Closed wooden doors for entities that can't open/break them.
 * 7) Ok.
 * 8) * Anything that's not one of the other categories.
 * 9) Kind-of ok.
 * 10) * Open trapdoors within the position, or the position is completely over air, water, or lava.
 * 11) Closed trapdoor within position.
 * 12) Rails, unless the mob is already on or just above rails.
 * 13) Lava, unless the mob is already in lava.
 * 14) Water.
 * 15) Fire at ground level adjacent to the position.
 * 16) Fire within the position.
 * 17) Cactus at ground level adjacent to the position.
 * 18) Cactus within the position.

But sometimes the weights change: As far as changes since previous versions, it looks like they added the "avoid" states where previously it was just "ok to go here" or "never go here", and the cactus bits, and removed the EntityAITempt routine effectively setting #7 to "ok" since the default is now "avoid" rather than "never". I don't know if someone can turn all that into something useful. Anomie x (talk) 23:55, 30 September 2015 (UTC)
 * Blazes change #8 and #9 to "ok to go here" (weight 1).
 * Blazes change #6 to "avoid this" (weight 8), rather than "never go here" (weight -1).
 * Blazes and endermen change #7 to "never go here" (weight -1).
 * Chickens, mobs leashed to an entity, and tamed mobs following their owner change #7 to "ok to go here" (weight 1).


 * Is this all just in "wander around randomly" mode, or do these apply when pursuing food, a target to attack, a door for the night, etc? – Sealbudsman talk/contr 02:37, 1 October 2015 (UTC)
 * This applies for anything that does pathfinding. I don't know if there are types of movement (for ground-based mobs) left that don't do pathfinding. I also don't know how it might work that one type of movement won't go into an "avoid" position at all while another will go ahead if there's no better path. Anomie x (talk) 02:53, 1 October 2015 (UTC)


 * So, what exactly is meant by "or the position is completely over air, water, or lava", in item #3? The rest seems pretty self explanatory.  – Sealbudsman talk/contr 15:04, 1 October 2015 (UTC)
 * If the mob is more than 1 block wide and the position is over e.g. 1 solid block and 3 air blocks, it wouldn't be completely over air blocks. Anomie x (talk) 01:37, 2 October 2015 (UTC)
 * Oh also, in #1 when you say "most blocks made from a movement-blocking material," are you saying the code checks something about the block's material, or is this really talking about the collision box? – Sealbudsman talk/contr 15:09, 1 October 2015 (UTC)
 * Referring to the property described on Materials. Anomie x (talk) 01:37, 2 October 2015 (UTC)