mojira.dev
MC-179916

Foxes path towards origin (0,0) during a thunderstorm

The bug

No matter the location of a fox, they try to path towards the origin during a thunderstorm. 

Steps to reproduce

  1. Teleport around seventy blocks away from the center of the world:

    /tp @s 0 100 70
  2. Summon some foxes and set the weather to "thunder":

    /weather thunder

Observed behavior

Foxes will always pathfind to the center of the world (0,0) during thunderstorms.

Expected behavior

Foxes would not pathfind to the center of the world during thunderstorms.

Code analysis

Code analysis can be found in this comment.

Attachments

Comments 15

Affects 1.16 pre release 2

This explains why I had a LOT (about 50) foxes in my house.

Can confirm in 20w51a.

The 0 0 of my world is ocean more than 20 blocks from the shore and always has 5-10 foxes in a huddle when I come by.

5 more comments

Can confirm in 1.18.1.

Code analysis (1.18.1 yarn mapping): (credit to Harley Speedthrust on YouTube and Aria on Fabricord, see the original analysis on YouTube comment)

FoxEntity$AvoidDaylightGoal extends EscapeSunlightGoa. EscapeSunlightGoa defines three doubles for the target X/Y/Z coordinates, and is initialized to 0 by default. This is set by EscapeSunlightGoal#targetShadedPos. However, this method will not be called if it is thundering; AvoidDaylightGoal#canStart L1017 early-returns true if it is thundering, skipping the method call at the end of canStart method. Since the target position is never set, it will always be 0, 0, 0.

Can confirm in 1.18.2.

not fixed. still happens in 1.19

@unknown, I wasn't able to reproduce this behavior in 1.19. This issue was fixed in 22w12a.

[media]

William Davis

gegy

Confirmed

Normal

Mob behaviour, Performance

1.14.4, 19w42a, 1.15.2, 20w06a, 20w07a, ..., 21w40a, 21w42a, 1.18 Pre-release 8, 1.18.1, 1.18.2

22w12a

Retrieved