
Pets stop wandering when you move a few blocks away from them
ImpSpy2 opened this issue ยท 3 comments
Once you move a little bit away they will stop where they are and follow the movement of the player with their head. This is more of a feature request to be closer to the behaviour from the Domestication Innovation mod where the pet is fully independent if you walk away from them than a bug in the mod.
Wow, now that you point that out - they absolutely are staring!
I never actually noticed because I was mostly using/testing this mod indoors or in small spaces and this doesn't happen at close range. Them stopping after moving out of a certain range looked normal to me - I always thought "they are searching a new goal" or "they are out of simulation distance" or something, but no, that's not it.
What's happening is that the mod keeps the FollowOwnerGoal
in a constant "starting" state - so the goal is active but doesn't actually cause the follow/teleport behavior. This does however cause the staring behavior and it can even block other goals, which is definitely not the intended behavior!
Looks like this was broken since at least version 0.4.1, oof.
I've now rewritten this to completely abort the goal and it's already looking much better! No staring, proper wandering even in a long distance.
I'll do some more testing on this and finally release it as the 1.0 version, it's only fitting.
Thanks for pointing out this crucial issue!
Just released version 1.0 which should fix this for good!
It turns out that even in vanilla, wolves stop wandering around after a while if the player isn't within ~32 blocks of them.
For wild wolves that makes some sense from a performance perspective (pathing is relatively expensive) and since vanilla pets either sit or closely follow the player, this behavior wasn't really visible.
Oddly enough though, tamed cats do wander around even when no player is near.
That is because the game counts them as "persistent", whereas wolves aren't, even if tamed. Normally "persistent" means "does not despawn" (e.g. a Name Tag makes a mob persistent) but wolves use a slightly different logic to that (the basic "animals do not despawn" logic) and I think it is an oversight of Mojang that the WanderAroundGoal
doesn't respect that, hence I fixed it.
This means all tamed pets will now properly wander around even if no player is near!