Minecraft
  1. Minecraft
  2. MC-87988

Fishing rod sometimes cannot reel in entities

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 15w36c, Minecraft 15w44b, Minecraft 15w47c, Minecraft 1.9.2, Minecraft 16w15b, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 1.10.2, Minecraft 16w41a
    • Fix Version/s: Minecraft 16w43a
    • Security Level: Minecraft - Public (Viewable by everyone)
    • Confirmation Status:
      Confirmed

      Description

      Introduction

      These behaviours seems to affect survival and creative mode and can be reproduced nearly all the time. There are also other situations which cannot be reproduced that easily.

      Sitatuations

      Catching a mob at the bottom of its hitbox

      It seems like catching a mob (and also Minecarts and ArmorStands) at the bottom of its hitbox and then trying to pull it, will never work (see screenshot).

      Pulling from above

      It seems like trying to pull a mob up often does not work when doing it straight above it.

      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.

      When an entity is caught first the field net.minecraft.entity.projectile.EntityFishHook.caughtEntity is set and then the DataParameter net.minecraft.entity.projectile.EntityFishHook.field_184528_c is set to the entity id + 1. The problem is that after that the method net.minecraft.entity.projectile.EntityFishHook.notifyDataManagerChange(DataParameter<?>) is called which sets the caught entity to null if it was not null (which is the case) and the stored entity id + 1 is greater than 0, which means an entity id stored, which is the case as well. This could be solved by only changing the caught entity if its entity id + 1 is not the stored entity id + 1 and then not setting it to null, but instead to the corresponding entity.

      public void notifyDataManagerChange(DataParameter<?> key)
      {
          if (field_184528_c.equals(key))
          {
              int i = ((Integer)this.getDataManager().get(field_184528_c)).intValue();
      
              // Replaced this
              //if (i > 0 && this.caughtEntity != null)
              //{
              //    this.caughtEntity = null;
              //}
              if (i == 0 && this.caughtEntity != null) {
                  this.caughtEntity = null;
              }
              else if (i > 0) {
                  Entity expectedEntity = this.worldObj.getEntityByID(i - 1);
                  if (this.caughtEntity == null || !this.caughtEntity.equals(expectedEntity)) {
                      this.caughtEntity = expectedEntity;
                  }
              }
          }
      
          super.notifyDataManagerChange(key);
      }
      

      The reason why you can sometimes reel in entities is because after the caught entity is set to null, its entity id is still stored. If the fishing hook is still close enough to catch the entity it sets the caught entity and then the entity id + 1. Because the entity id + 1 is still the same, the method net.minecraft.entity.projectile.EntityFishHook.notifyDataManagerChange(DataParameter<?>) is not called and the caught entity remains. As this bug shows this is not always the case and this behaviour is still very likely not the intended one.

        Issue Links

          Activity

          Hide
          Yannic Mödritscher added a comment -

          Still there in all 1.9 versions. (Testet it from 1.9 to 1.9.4).
          It might also by caused by other Entitys colliding with the Hitbox.

          Show
          Yannic Mödritscher added a comment - Still there in all 1.9 versions. (Testet it from 1.9 to 1.9.4). It might also by caused by other Entitys colliding with the Hitbox.
          Hide
          Brenden Smith added a comment -

          Still affects the current released and development versions (1.10.2, 16w41a)

          Show
          Brenden Smith added a comment - Still affects the current released and development versions (1.10.2, 16w41a)

            People

            • Assignee:
              [Mojang] Maria Lemón
              Reporter:
              [Helper] Marcono1234
            • Votes:
              17 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: