mojira.dev
MC-85177

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

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.

Related issues

Attachments

Comments

migrated
[media]
migrated

This ticket is incomplete. Please review the guidelines before reporting issues.
For technical support please use the Mojang Support Center.

--- This action was performed automatically. If you believe this was done erroneously, please :light_bulb_on: raise an issue.

marcono1234

Confirmed for

  • 15w49b However I do not really understand how MC-77758 can be fixed then. Maybe it is based on the graphics card

kumasasa

Crash report ?

marcono1234

Also seems to happen only when guardians are targetting players, the beam is visible however when they target squids
Edit: Crash report is now attached

marcono1234

After I restarted the game, the beams were visible again, I do not know what the problem was
Seems however like someone else experience this a while back as well: MC-58426

migrated

Confirmed for 18w03b

pokechu22

Fixed in 19w05a by starting entity IDs at 1 instead of 0. However, guardians still are unable to target entities with ID 0; it's just much less likely of a scenario (I've created MC-181129 to track that part; 19w05a and 19w06a are listed on this ticket due to me only checking the metadata format). Note that 19w05a also added an optional entity ID metadata type, which was used for fireworks; see MC-111480.

lord.quadrato

(Unassigned)

Confirmed

Entities, Networking

beam, entity, guardian, targeting

Minecraft 15w32a, Minecraft 15w49b, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.2, ..., Minecraft 19w03a, Minecraft 19w03c, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a

Minecraft 19w05a

Retrieved