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

Guardian beam is not rendered if targeted entity is the first entity in the world

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 19w05a
    • Minecraft 15w32a, Minecraft 15w49b, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.2, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 18w03b, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4, Minecraft 1.13-pre5, Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13-pre8, Minecraft 1.13-pre9, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w46a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03c, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a
    • Confirmed
    • Entities, Networking

      The bug

      The guardian beam is not rendered if the attacked entity has the entity id 0, which is also the entity id used by the first entity in the world (usually a player).

      How to reproduce

      1. Create a new "The Void" Superflat world or load a world which has not entities in it
      2. Summon a guardian
        /summon armor_stand ~ ~ ~ {Passengers:[{id:"guardian"}]}
        
      1. Switch to Survival or Adventure mode
        You should see that the beam is not rendered

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The data parameter net.minecraft.entity.monster.EntityGuardian.TARGET_ENTITY stores the entity id of the targeted entity. 0 is used as default value and to indicate that no entity is targeted. The problem is that the method net.minecraft.entity.monster.EntityGuardian.AIGuardianAttack.updateTask() directly stores the entity without increasing it by 1. Therefore entities with entity id 0 are treated as not targeted.

      Note: Possible other solutions are to start the entity ids always at 1 or to introduce new optional data parameters.

            Unassigned Unassigned
            Lord_Quadrato [Helper] Lord_Quadrato
            Votes:
            10 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: