See attached screenshot
Expected behaviour:
Trident staying in hand
To reproduce:
Enter a multiplayer server,
Ask a player to hold up a trident and shift.
Observe how trident floats above hand
Related issues
is duplicated by
relates to
Attachments
Comments


I also have this problem in single player

I tested this issue with other poses in MC-125748, but since it has been considered as a dupe, I'll explain it again.
This issue affects both single player and multiplayer, when holding the trident on the mainhand, offhand, and both, and while standing upright and swimming. You can also notice that duel wielding tridents on both hands makes the player lift both hands when attempting to throw it(MC-125337). While swimming, other items as well as the trident are affected by this hovering glitch.

Still an issue in 18w20a

Affects 1.13-pre1

Not fixed in 1.13-pre5

Still an issue in pre6

Affects 1.13-pre7

Affects 1.13-pre7 i confirm
Confirmed for 18w30b
Confirmed for 18w31a
Confirmed for 18w32a
Confirmed for 18w33a
Confirmed for 1.13.1-pre1

Confirmed for 1.14.3-pre3
The issue is in the LayerHeldItem.renderHeldItem method (MCP 1.12.2 names). First the item is rotated by the arm rotation (translateToHand), and then if the player is sneaking it is translated 0.2 units downwards. However, this is 'downwards' relative to the arm rotation. When the arms are fully raised (aiming a trident when not swimming), the item is actually translated 0.2 units upwards. This can be fixed by applying arm rotations after the sneak translation.

Interestingly it seems this issue has been partially fixed (not sure exactly when, but testing in 1.14.4). Items are now positioned correctly while swimming, but the issue still exists for sneaking (the main focus of this report).
As of 19w39a, the issue also happens if you're not charging the trident, see MC-162374.

Appears to be fixed in 19w42a. Can someone please double check.
Confirmed fixed in 19w42a.