Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-100237

Villagers in house with center at x = -1 continuously search for nearby villages



    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.9, Minecraft 1.11.2, Minecraft 17w06a
    • Fix Version/s: None
    • Labels:
    • Confirmation Status:
    • Category:


      The bug

      Villagers in a house whose center is at x = -1 look for nearby villages every time their EntityAIMoveIndoors tests if it should execute and try to move to the center of the closest house (in which they are already).

      How to reproduce (vanilla)

      1. Place a block at x = -1
      2. Build a "house" as shown in House setup (17w06a).png around the block
      3. Build a second house whose center block is not at x = -1 next to it
      4. Place on both center blocks a shulker or any other entity which has a collision box
      5. Set the time to night and spawn some villagers
        /time set 16000

        → You should see that the villagers in the house at x = -1 continuously jump around the shulker, even if they have been in the house for some time, whereas the villagers in the house which is not at x = -1 only jump around the shulker for some time after entering the house but stop then and don't start again.

      Note: You might see villagers jumping in the house which is not at x = -1. This happens probably because the villagers want to randomly move on top of the block in the center. This should happen less frequent than the villagers jumping in the house at x = -1.

      How to reproduce (with MCP)

      1. In MCP set a breakpoint for the method net.minecraft.entity.ai.EntityAIMoveIndoors.shouldExecute() at the moment it calls the method net.minecraft.village.VillageCollection.getNearestVillage(BlockPos, int)
      2. Place a block at x = -1
      3. Place a wooden door two blocks in front of the block

      The reason

      The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

      The reason why this happens is because the class net.minecraft.entity.ai.EntityAIMoveIndoors uses the value -1 to indicate that no house was found. This is in conflict with houses at the position x = -1.




            • Assignee:
              marcono1234 [Mod] Marcono1234
            • Votes:
              1 Vote for this issue
              2 Start watching this issue


              • Created: