The Bug
When removing a mounted mob’s leash from a fence (e.g., pig, horse) while already riding that mob, the leash will be transferred to you while riding the mob. This causes you to hold the leash to the mounted mob while riding it. This is not usually possible.
Steps to Reproduce
Place a fence and summon a pig wearing a saddle.
Leash the pig to the fence.
Ride the pig, and then right-click on the fence.
Observed Results
The pig is leashed and ridden at the same time.
Expected Results
If the player is riding the mob it was attached to, the lead drops as an item instead of being leashed to them. If the player is not riding the mob, the leash should be transferred like normal.
Additional Notes
This does not seem to cause gameplay issues.
This could be intended but I can confirm.