Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-118394

Can interact with entities and block entities through other entity hitboxes under certain circumstances

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.12, Minecraft 17w50a, Minecraft 18w20c, Minecraft 1.13.1, 21w06a, 21w07a, 1.20.2, 23w44a, 1.20.3, 1.20.4 Release Candidate 1, 1.20.4, 23w51b
    • Confirmed
    • Hitboxes

      The bug

      The player can interact with entities and tile entities while inside of an entities hitbox under some circumstances.

      How to Reproduce:

      1. Load the following datapack into your world:
        hitbox_collision.nbt
      2. Press the button in their respective marked orders on the signs
      3. Stand inside the 1st armor stand's hitbox (The oldest entity)
      4. Look straight forward to the second armor stand
      5. Right click the chest
        You are only able to open the chest
      6. Stand inside the second armor stand (The second oldest entity)
      7. Look straight forward to the first armor stand
      8. Right click the chest
        You cannot open the chest
      9. Aim your cursor where the slime's hitbox and chest meet
      10. Right click
        You can open the chest

      Screenshots/Videos:

      2023-11-02_21-33-27.mp4

      Notes:

      1. This issue also applies to things such as the attack indicator. When following the same steps listed above, instead of trying to right click a chest, if you hold a tool or weapon instead the observed results will be an inconsistent and unreliable display of the attack indicator.
      2. Turning on entity hitboxes helps reproducing this issue. (F3 + B)

      Code Analysis:

      (From Remin)
      Based on 1.11.2 decompiled using MCP 9.37
      The method net.minecraft.client.renderer.EntityRenderer.getMouseOver(float) does not consistently define which entity should preferred. Expected would be probably:

      1. Closest entity intersecting with player's eye level
      2. If no entity intersecting with player's eye level exists closest entity in ray from player's eyes

        1. hitbox_collision.nbt
          1 kB
        2. Example.png
          Example.png
          388 kB
        3. alignment.png
          alignment.png
          18 kB
        4. 2023-11-02_21-33-27.mp4
          248 kB

            Unassigned Unassigned
            Jingy [Helper] Jiingy
            Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: