With the Independent Pets mod, the behavior of tamed animals in Minecraft will become much more realistic. With this mod, you can disable the follow and teleport function for any tamed mobs, even if they were added with other mods. And if you want them to follow you, they will not be as boring as they used to. For example, dogs can explore the area, and cats will climb different blocks.
This is the Fabric version and the Forge mod you can download here.