mojira.dev

Socram

Assigned

No issues.

Comments

More technical information and why the bug is happening:

  • The reason wolves do not attack seems to be caused by net.minecraft.world.entity.ai.goal.target.TargetGoal.canAttack checking if this.mob.isWithinHome(target).
    If the target (the enemy) is not within the bounding boxes defined by its home and radius position (and after travelling to the nether, it’s highly unlikely), the wolf simply does nothing.

  • The reason why their home_radius and home_pos are not unset despite being unleashed is the order of operations in which the teleport occurs in net.minecraft.world.entity.Entity.teleportCrossDimension:

    • A new Entity copy is created in the destination world

    • copy.restoreFrom(this) is called, which copies all NBT properties of the entity. At this point the entity still has the home position set.

    • this.removeAfterChangingDimensions() is called which unleashes the entity and clears the home position.

The solution is very simple: the unleash operation should be performed in the teleportCrossDimension method BEFORE calling copy.restoreFrom(this).

@Vyoejp I don’t think they are the same bug.

  • In MC-307069, despite the wolf stops attacking mobs after a world reload, they’ll attack again if you hit another mob. They simply forget the target.

  • In this bug, however, hitting another mob will not make the wolf attack. It is a persistent AI behaviour flag that can only be solved by changing the NBT fields or leash+unleashing them.