-
Bug
-
Resolution: Fixed
-
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
- 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.
- relates to
-
MC-111480 Firework boosting doesn't work in the first world loaded after a game start / if player has entity id 0
- Resolved
-
MC-165595 Guardian beam does not render when over a certain "Time" in level.dat
- Resolved
- testing discovered
-
MC-181129 Guardian beam is not rendered if targeted entity has ID 0, as it does not use the OptionalInt metadata type
- Reopened