mojira.dev
MC-107103

Trying to interact with entity 3 or more blocks away without seeing its eyes only interacts client-side

The bug

Trying to interact with an entity which is 3 or more blocks away without seeing its eyes only causes the interaction to happen only client-side. This can lead to ghost items or other weird behavior.

Example interactions

Interaction

Result

Using a Name tag on a mob

The mob is named for client, but it can despawn, commands won't find it by the name, and the name disappears after a re-log. The name tag disappears from the inventory (survival) and returns back if you update the slot it was in

Using a Flint and Steel on a creeper

Sound of igniting the entity

Milking a cow or a mooshroom (MC-94008)

Ghost buckets of milk that become empty buckets if you update them

Shearing a mooshroom

Mooshroom disappears until you re-log in

Trying to ride a horse / llama

Player is only rotated

How to reproduce (horse)

  1. Summon a horse

  2. Make sure you are three or more blocks away from it and that you cannot see its eyes

  3. Right click the horse
    → The rotation of the horse is applied to you but you did not mount the horse

How to reproduce (name tag)

Creepers in

[media]

represent 3 cases (from left to right) in which the mob is behind (glass) blocks.

  • In the 1st and the 2nd case you should stand on sandstone blocks or top of sandstone stairs to reproduce the bug.

  • In the 3rd case you should be at least 2.625 blocks higher than the mob (0.625 = 6 snow layers) and 1 block away from it

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.network.NetHandlerPlayServer.processUseEntity(CPacketUseEntity) requires the player to see the eyes of the entity (method EntityLivingBase.canEntityBeSeen(Entity)). This check might make no sense because you are not always trying to interact with the head of an entity.

Related issues

Attachments

Comments

migrated
[media][media]
SunCat

Relates to MC-95720

SunCat

@unknown, This bug is about entities, not blocks (of lava)

migrated

In the table it says that the name disappears after relog and the tag is returned, but none of that happened on my side, and other people were able to see the named entity :/ (someone even left a sign telling me how to move it without a leash since leashes are bugged for ocelots and wolves)

also worth noting that my ocelot did not despawn for 2 days. I relogged multiple times during that period and even closed the game entirely several times due to lag or invalid sessions, every time she was still where I left her :/

migrated

Confirmed for 17w16b, reproduced with milk buckets, like demonstrated in MC-94008.

Shearing a mooshroom in 17w16b gives me a regular cow (and red shrooms) rightaway, the cow doesn't disappear optically? (Or did I maybe misunderstand the described issue for mooshrooms?)

SunCat

The mooshroom disappears for me. Did you try to reproduce it the same way you reproduced with milk buckets?

migrated

Turns out I was a bit too close (on the ladder) to the mooshroom, now with the correct minimum distance it also disappears for me 😃 I don't know if it's important to mention, but the mooshroom can still be found via entitydata or an e.g. say- or tp-command (and dies if you place a lavabucket where it invisibly stands >.>), but despite that, you can't seem to leash it while it's in that ghost-mode (at least it doesn't work for me); if a Glowing:1b is set to it before or also after the "ghost-shearing", you also still can't see it.

If you leashed it before you "ghost-sheared" it and attached the leash to a fence, after the "ghost-shearing" the leash knot on the fence is there, but you can't see the leash leading to the mooshroom. Upon relogging everything looks normal.

migrated

Confirmed for 17w17a and b.

migrated

Confirmed for 17w18a.

migrated

Confirmed for 1.12 pre-3.

migrated

Confirmed for 1.12 pre-5.

migrated

Confirmed for 1.12 release.

migrated

Confirmed for 1.12.1.

migrated

Confirmed for 1.12.2 pre-2.

migrated

Confirmed for 1.12.2 release.

migrated

Confirmed for 17w43b.

migrated

Confirmed for 17w46a.

migrated

Confirmed for 48a.

migrated

Confirmed for 18w01a.

migrated

Confirmed for 18w03b.

migrated

Confirmed for 18w22a.

lord.quadrato

Confirmed for 18w22c

lord.quadrato

Confirmed for 1.13-pre1

migrated

Confirmed for 1.13 pre-2.

lord.quadrato

Confirmed for 1.13-pre3

lord.quadrato

Confirmed for 1.13-pre5

migrated

Usually I only test shearing a mooshroom, but as it did not disappear in 1.13.1 pre-1 as usual, I also tested the milking and the nametags. Both still occur for me, but not anymore the disappearing when shearing, in 1.13.1 pre-1.

migrated

In 18w49a, the mooshroom still does not disappear anymore when shearing.

For milking, the bug still occurs (bucket shows milk, until you update it by moving the bucket in your inventory).

migrated

I believe I found this bug on 1.14.4 - in survival mode, a creeper naturally spawned in a little spot I had hollowed out of a mountain for my mule. I thought it was pretty funny, so I went and made a name tag for it, entered creative mode, gave him a nice little home and named him Henry. I then walked off not too far away (unsure, no more than 200 blocks though) and came back to see he wasn't there anymore. No explosion damage anywhere despite being surrounded by cobblestone and dirt and the entrance sealed with panes so he wouldn't aggro.

 

Sorry if that's too much info, but I'm not certain if I'm on the right bug page. It just sounds like a similar issue.

migrated

Affects 1.14.4

migrated

I've also experience this bug, with milking cows, in 1.14.4.

SunCat

coschevi

Confirmed

Entities

client-side, interaction, player

Minecraft 1.10.2, Minecraft 16w36a, Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w39b, ..., Minecraft 1.13.1, 1.14.4, 1.15.1, 20w06a, 20w07a

20w21a

Retrieved