mojira.dev
MC-77576

Guardian Eye will follow players in Spectator mode

The Bug

If you are in spectator mode, the eye will follow you.

Steps to Reproduce

  • Summon a guardian.

    /summon minecraft:guardian ~ ~ ~ {NoAI:1b}
  • Switch into spectator mode and look at the eye of the guardian.

  • Move left and right.

  • Take note as to whether or not the eyes of guardians follow players in spectator mode.

Observed Behavior

The eyes of guardians follow players in spectator mode.

Expected Behavior

The eyes of guardians would not follow players in spectator mode.

Related issues

Attachments

Comments

migrated
[media][media]
migrated

Anything flowing out of noAI is intended and won't be changed. They're not going to rewrite a large chunk of code just so the eye doesn't follow with noAI.

marcono1234

if you are in spectator mode, the eye will follow you

could be problematic, but they have to decide if they consider it as a bug

Confirmed for

  • 1.8.4

Torabi

Simplifying to the remaining issue that isn't already covered by other issues.

marcono1234

I just tested it and it always focuses the nearest the player watching it as it is rendered client side.

However it would be still fixable by just adding this condition in front of the eye rendering in the ModelGuardian.java (1.8) class (1.8 MCP names):

if (!Minecraft.getMinecraft().playerController.isSpectatorMode())

So it would look like this:

ModelGuardian.java (1.8)

if (!Minecraft.getMinecraft().playerController.isSpectatorMode()) {
	this.guardianEye.rotationPointZ = -8.25F;
	Object var26 = Minecraft.getMinecraft().func_175606_aa();
	

	if (var8.func_175474_cn())
	{
		var26 = var8.func_175466_co();
	}

	if (var26 != null)
	{
		Vec3 var18 = ((Entity)var26).func_174824_e(0.0F);
		Vec3 var19 = p_78087_7_.func_174824_e(0.0F);
		double var20 = var18.yCoord - var19.yCoord;

		if (var20 > 0.0D)
		{
			this.guardianEye.rotationPointY = 0.0F;
		}
		else
		{
			this.guardianEye.rotationPointY = 1.0F;
		}

		Vec3 var22 = p_78087_7_.getLook(0.0F);
		var22 = new Vec3(var22.xCoord, 0.0D, var22.zCoord);
		Vec3 var23 = (new Vec3(var19.xCoord - var18.xCoord, 0.0D, var19.zCoord - var18.zCoord)).normalize().rotateYaw(((float)Math.PI / 2F));
		double var24 = var22.dotProduct(var23);
		this.guardianEye.rotationPointX = MathHelper.sqrt_float((float)Math.abs(var24)) * 2.0F * (float)Math.signum(var24);
	}
}

Note however that it can still be considered as a bug that a guardian is not looking at the closest player.

wobst.michael

Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.

muzikbike

Can confirm for 1.13.1-pre1

muzikbike

Affects 1.13.1-pre2

migrated

Confirmed for 1.13.1.

bemoty

@unknown you mean for 1.13.1?

migrated

migrated

Confirmed for 1.13.2-pre1.

muzikbike

Can confirm for 20w07a. Can I request ownership?

marcono1234

@@unknown, you are the reporter now.

migrated

Confirmed for 20w19a

migrated

20b

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w05b.

Avoma

Can confirm in 21w06a.

Avoma

Can confirm in 21w07a. Video attached.

Avoma

Can confirm in 1.16.5 and 21w10a.

Avoma

Can confirm in 21w11a.

Avoma

Can confirm in 21w17a.

Avoma

Can confirm in 1.17.

Avoma

Can confirm in 1.17.1.

Avoma

Can confirm this behavior in 21w41a. Here are some extra details regarding this problem.

The Bug:

The eyes of guardians follow players in spectator mode.

Steps to Reproduce:

  • Summon a guardian.

/summon minecraft:guardian ~ ~ ~ {NoAI:1b}
  • Switch into spectator mode and look at the eye of the guardian.

  • Move left and right.

  • Take note as to whether or not the eyes of guardians follow players in spectator mode.

Observed Behavior:

The eyes of guardians follow players in spectator mode.

Expected Behavior:

The eyes of guardians would not follow players in spectator mode.

Avoma

Can confirm in 1.18.1.

Avoma

Can confirm in 1.18.2.

Avoma

Can confirm in 1.19 and 22w24a.

Avoma

Can confirm in 1.19.2.

muzikbike

(Unassigned)

Confirmed

Gameplay

Low

Mob behaviour

floodlight-zone, guardian

Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.4, Minecraft 1.13, Minecraft 1.13.1-pre1, ..., 1.20.2, 1.20.4, 1.20.6, 1.21, 1.21.4

Retrieved