Tamed mobs stopped functioning properly after teleported with waystone and leash
Cynicizm opened this issue ยท 2 comments
Minecraft Version
1.16
Mod Loader
Forge
Mod Loader Version
36.2.2
Mod Version
Latest
Describe the Issue
Whenever I teleport with a leashed tamed mobs (both vanilla and modded), they stopped attacking any other mobs that I attack or attack me. This happens right after the teleportation process is done.
They still follows you around and wander as usual when ordered to follow. Just completely stopped helping you on offense.
Tested on mobs such as vanilla wolves, Alex's Mobs' Capuchin Monkey and Quark's Foxhound.
This occurred on a Forge multiplayer server.
Logs
No response
Do you use any performance-enhancing mods (e.g. OptiFine)?
Optifine
This seems to be a vanilla bug. However, I can't create an account on Mojang's JIRA and can't find another way to report a bug, so if anyone already has an account, please go ahead and let them know.
When leashing a mob, restrictTo
is called on the mob to restrict some of its AI (such as random movement, following and attacking / protecting) to the area around the leash holder.
However, even once unleashed, clearRestriction
is never called, meaning the mob will always be considered "restricted" to the area it was last unleashed in. It will be unable to attack any mobs outside of that area as they are not "within restriction".
- Leash a wolf
- Unleash a wolf
- Move sufficiently away from the position you unleashed the wolf (e.g. 10+ blocks)
- Spawn and attack a sheep - the wolf will not attack because
isWithinRestriction
returns false
Checking with a debugger confirms that restrictRadius
remains at 5.0
even after the mob has been unleashed.
This seems to be tracked in https://bugs.mojang.com/browse/MC-221754 so closing it here.