Entities cannot be hooked by fishing rods if the line is cast while the player (or caster in general) is submerged in water.
Steps to Reproduce:
Spawn an entity underwater
Try and hook the entity with a fishing rod item
Observed Results:
The line will be cast, but will not latch onto the entity. Instead, it will function like you are normally fishing.
Expected Results:
The bobber would be able to latch onto the entity regardless of submersion.
Screenshots/Videos:
[media][media]
Notes:
Considering the player is unable to fish while the bobber is underwater, it would make sense that the bobber function as it would above land when trying to hook an entity.
Related issues
Attachments
Comments


Can confirm.
This behavior is present in 1.17.1 as well and isn't exclusive to the 1.18 snapshots.

Affects 1.18.1

Affects 1.18.2

Affects 1.19
Can confirm in 23w44a. I would like to request ownership considering the original poster has been inactive since 2021.

I'm still there, just that there is no improvement in the recent versions.
Hi, if it still affects current versions, it would have helped if you'd kept your issue up-to-date so we know it's still valid. That's why ownership has been transferred to @unknown to make sure it stays up to date in the future.

It seems this issue is caused by the fact that collision checks are only made during the initial state ("FLYING").
Once the bobber enters a block that has water in it (it seems it doesn't even need to touch the water, just be on the same block), it changes to the "BOBBING" stage. Once that has happened, there seems to be no branch in the code to change the state ever again. That means that it just is in BOBBING state forever. Thus, the collsiion check is never reached, causing it not to attach to an entity.

If you want to reproduce this, note that the player's hitbox has to be entirely within water to reproduce the issue. Can confirm in 1.20.5.