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

Creative Entity Reach Distance is truncated to 5.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 1.18.2, 22w16b
    • None
    • Confirmed
    • (Unassigned)

      In GameRenderer#pick, creative players have their entity pick distance set to 6.0, which should allow them to interact with an entity up to 6 blocks away from their current location.

      Before this, a block pick has already been done based on the current reach distance (5.0 for creative players).

      Next, a check is made to see if the distance of the block hit is higher than the max entity reach distance.  This check is presumably done to ensure that if a block is hit, than any entities hit must be closer than this block. 

      However, only a null check is done, and thus empty (failed) hit results will truncate the entity pick distance to the reach distance.  This is fixed by checking if the hit result is empty.

      Original Check:

      if (this.minecraft.hitResult != null) {

      Proposed:

      if (this.minecraft.hitResult != null && this.minecraft.hitResult.getType() != Type.MISS) {

      This change ensures that the proper creative player entity reach distance is used, regardless of the block reach distance.

            Unassigned Unassigned
            Shadows_of_Fire Shadows_of_Fire
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: