-
Bug
-
Resolution: Duplicate
-
None
-
Minecraft 1.9.2, Minecraft 16w15b
-
None
-
Confirmed
Note: I have looked into this issue as I thought it was an issue with my mod, and will try to save you time by giving my analysis of the issue at the end. This analysis is done in MCP 1.8.9, so things may be a little different in 1.9+
Issue:
The issue is that if the player's look ray doesn't hit any bounding box and doesn't go through an "un-collidable" block such as air, the hit position is null. This means that every time a player clicks (right or left) the log message [Client thread/ERROR]: Null returned as 'hitResult', this shouldn't happen! is printed.
Reproducing:
Put a long line of bottom slabs, longer than the reach distance of the player, and look through them without the look ray going outside the block bounds. Right or left click and look at the logs.
My analysis:
Everything here is using MCP 1.8.9-11.15.1.1808
Toward the end of World.rayTraceBlocks the variable movingobjectposition2 is only set if Block.canCollideCheck() is false, but all of the blocks do have collide checks, so movingobjectposition2 is never set. The problem comes in when all of the blocks return null from the Block.collisionRayTrace() method, since no MOP is returned, it goes on to returnLastUncollidableBlock ? movingobjectposition2 : null, but since all of the blocks had collide checks this was never set to anything but null, meaning Minecraft.objectMouseOver is set to null.
- duplicates
-
MC-79925 null hitResult when no entity or block is in focus while looking through blocks without the ray trace intersecting the blocks themselves
- Resolved