Mojira Archive
MC-93768

Guardian beam creates air bubbles on land

The bug

When a guardian targets a player or squid on land the beam shows air bubbles.

How to reproduce

  1. Summon a guardian (riding an armor stand) on land using the following command:
    /summon minecraft:armor_stand ~ ~ ~ {Passengers:[{id:"minecraft:guardian"}]}
  2. Switch to survival mode /gamemode survival
    When the guardian attacks, air bubble particles appear in its beam

Expected behavior

Because the guardian is already on land, the particles from its beam should not include air bubbles.

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.

The affected method is net.minecraft.entity.monster.EntityGuardian.onLivingUpdate(). This method first tests if the Guardian is in water and the beam is active and then creates air bubbles. However after this it tests if the guardian targets an entity and then creates air bubbles without testing if the Guardian is in water.

Note: I am not sure if it is intended that Guardians that target an entity in water create air bubbles twice.