Waystones

Waystones

123M Downloads

Tamed mobs stopped functioning properly after teleported with waystone and leash

Cynicizm opened this issue ยท 2 comments

commented

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

commented

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".

  1. Leash a wolf
  2. Unleash a wolf
  3. Move sufficiently away from the position you unleashed the wolf (e.g. 10+ blocks)
  4. 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.

commented

This seems to be tracked in https://bugs.mojang.com/browse/MC-221754 so closing it here.