The bug
When the player throws a trident enchanted with riptide at an enderman, it will not teleport and take damage. Doing the same with an unenchanted trident appears to cause a successful hit, but the enderman teleports away and is not damaged (MC-109147)
What I expected to happen was:
The enderman would teleport away and not take damage.
What actually happened was:
The enderman does not teleport away and takes damage.
How to reproduce
Download and install the attached datapack
(a guide on how to do that can be found here)
Run the following command from your chat input (make sure cheats are enabled, doesn't work if run from a command block)
/function mc-134556:mc-134556
You will receive a trident enchanted with riptide and it will start to rain. An enderman will spawn nearby with a roof to protect it from the rain.
Throw the trident enchanted with riptide at the enderman.
→ ❌ The enderman doesn't teleport and takes damage
I believe this is intended. You are crashing into the mob, so the trident inflicts meelee damage as opposed to throwing damage (9 damage instead of 8), respects strength, and does damage to the enderman. Endermen are also able to dodge meelee weapons, but only if you try to hit them in in certain places (they also do this with thrown riptide tridents as expected, so technically what you expect to happen already happens in intentional cases), so I don't see a bug here. You would also expect to instakill a guardian and benefit from looting by holding a looting sword in the mainhand, and a maximized riptide and impaling trident in the offhand, all while having strength II, but that doesn't happen due to MC-136147.