This mods adds two new potion effects, Stun and Dormant Stun. Only Dormant Stun is accessible without commands, and can be made by brewing a Resin Clump and water bottles in a brewing stand. This Potion of Dormant Stun can also be made into splash potions, lingering potions and tipped arrows.
When an entity has the Dormant Stun effect, and the player who gave the effect looks at that entity they can't move until either the effect wears off or the player looks away. Note that this only works once, if the player looks away they can't be stunned again unless Dormant Stun is applied again.
The only requirement for this mod is Fabric API, so just download that along with this mod and drop them both in your mods folder.
Please head over to the Github and make an issue.

Adds a new potion effect that temporarily makes an entity get immobilized like the Creaking