Vanilla Handcuffs!
A simple mod that adds handcuffs to the game, craft them using 2 iron ingots and 4 iron nuggets.
Sneak behind a player and use the handcuffs to trap them. After a few seconds it will lose their inventory and be attached to the ground.
That's it! You get a unique key to relase the player! Don't lose it!
Spoiler
Villagers can also be chained