MobCapture is a small add-on that lets you capture mobs into a portable item and release them later. It is simple to use and craftable with common materials.
Place 1 Ender Pearl in the center of the crafting grid and surround it with 8 Glass. The recipe produces 4 Capture Orbs.

[ ] [ G ] [ ]
[ G ] [ E ] [ G ]
[ ] [ G ] [ ]
Where: G = Glass, E = Ender Pearl
/give @s mobcapture:mob_capture_orb 4
License: MIT