I have two custom entities. I want that when A bumps into B, A will start riding B (sort of like passengers with /summon command). How would I code that? I tried looking into boat mechanics but I didn't understand much.
EDIT:
I forgot to mention a pretty important element: I am coding a Fabric mod.