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
Create a new "The Void" Superflat world or load a world which has not entities in it
Summon a guardian
/summon armor_stand ~ ~ ~ {Passengers:[{id:"guardian"}]}
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
relates to
testing discovered
Attachments
Comments


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.

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

Crash report ?

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

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

Confirmed for 18w03b

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.