I had tackled with chain rendering in my previous post, after that I focused my efforts on making the chains work, actually drag the chained mobs to you.
I did this by applying a correction velocity to all chained mobs which is calculated by the difference between the mob and the player’s position.
In the attached picture you can see a chained chicken suspended in the air by me.
Originally I thought I would focus on the chain behavior but rendering seemed more interesting to do.
I referenced the vanilla chain model and leash rendering code and came up with this. It might need some tweaks later (like reducing the scale) but it’s good enough now.
It took me a lot of time to correctly calculate the UVs and vertex positions.
Also internally I opted on using Fabric’s Data Attachment API instead of trying to mixin into vanilla leash classes and it turned out to be a lot easier than I thought. It even handles client sync and saving!
I just finished my first silly Slack bot “Sally”! Maybe I will add more features to it in the future.. Art source: https://www.instagram.com/quartzstash/