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

Silverfish not moving when mobGriefing is false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 16w40a
    • Minecraft 16w35a, Minecraft 16w36a
    • None
    • Windows10
      Java 1.8.0 25 64bit
    • Confirmed

      When mobGriefing gamerule is false, silverfish won't even move, although will attack when on survival mode. Most likely caused by the fix of MC-80586.


      Code analysis by Neko:

      The reason for this is the Silverfish first checks if mobGriefing is false, if so, the code returns false and the Silverfish cannot attempt to path find.

      EntitySilverfish.java (MCP)
          static class AIHideInStone extends EntityAIWander
          {
              public boolean shouldExecute()
              {
                  if (!this.silverfish.worldObj.getGameRules().getBoolean("mobGriefing"))
                  {
                      return false;
                  }
                  else if (this.silverfish.getAttackTarget() != null)
                  {
                      return false;
                  }
                  else if (!this.silverfish.getNavigator().noPath())
                  {
                      return false;
                  }
                  else //...
              }
          }
      

            FruBasilicum [Mojang] Agnes Larsson
            gncinc Stuart Sterling Shoun
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: