mojira.dev
MC-250858

Creative Entity Reach Distance is truncated to 5.0

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.

Comments 4

This report does not describe a player facing bug in the game.

Actually it does, creative entity reach being 5 blocks, rather than 6.

Block reach distance is also increased in Creative mode, so I'd expect that to be the case for entity reach distance as well.

This issue can be fixed with a one line change in GameRenderer#pick

The check if (this.minecraft.hitResult != null) needs to be updated to if (this.minecraft.hitResult != null && this.minecraft.hitResult.getType() != HitResult.Type.MISS) so that it does not cap the distance when the block pick fails.

Shadows_of_Fire

(Unassigned)

Confirmed

(Unassigned)

1.18.2, 22w16b

Retrieved