mojira.dev
MC-260305

Interacting with wrong entity when inside entity

When standing inside the hitbox of an interaction while looking at a different interaction outside of the hitbox and either interacting or attacking you will hit the other interaction, not the one you are in. Interacting through the interaction while outside it does not produce this issue, your camera has to be inside the hitbox.

Linked issues

Attachments

Comments 9

What command(s) do you use?

OliTheHoodieBoi

I stored the interaction.timestamp to a scoreboard to see which interaction was interacted with

That is not the valid answer for the question.

The only commands needed are 2 summon commands to spawn the entities in; one at ~ ~1 ~2 and one at ~ ~1 ~; try interacting with the first summoned one, while your head is in the second one. Then just check the data of both with /data get

Can confirm. This affects all entities including mobs. And this is affected by the order of entity creating. Summon two entities and if your head is in the second one, you cannot interact with the first summoned one. If your head is in the first one, you can interact with the second summoned one. The expected behavior is the entity that your head is in should always be hit, and it should not affected by the entity summoning order.

Can confirm in 1.19.4-pre1.

Detail steps to reproduce:

  • Summon an entity:

    • /summon minecraft:interaction ~ ~ ~

  • Summon another entity some blocks away:

    • /summon minecraft:interaction ~ ~ ~2

  • Put your head in the first summoned one, face the second one and hit.

  • Check if the first one is hit:

    • /data get entity @e[type=minecraft:interaction,limit=1,sort=nearest]

I've encountered the same Bug while working on a project with a friend in 1.20.2 and have also noticed it occuring in 23w43b.

 

Edit: I have also had the Bug behave differently from world to world... In one world, it only happened while facing east, in another (the one from my screenshot), it only happened while facing north...

I did a bit of experimenting and this seems to only happen with entities outside of your current chunk

[media]

This bug still exists, even in 1.21.6. It seems that using entities to detect player clicks in mapmaking is still better than using interactions…

OliTheHoodieBoi

(Unassigned)

Community Consensus

Platform

Normal

Entities

Minecraft 1.12, Minecraft 17w50a, Minecraft 18w20c, Minecraft 1.13.1, 21w06a, ..., 23w44a, 1.20.3, 1.20.4 Release Candidate 1, 1.20.4, 23w51b

Retrieved