mojira.dev
MC-165448

Wither Skeletons' pathfinding is broken when their NBT is updated every tick

The bug

Originally I had a data pack but I narrowed down to 3 commands with 2 being ran every tick.

First command:

scoreboard objectives add Health dummy

Repeating command block:

execute as @e[type=minecraft:wither_skeleton,sort=nearest] store result score @s Health run data get entity @s Health 1

Chain command block attached to the repeating one:

execute as @e[type=minecraft:wither_skeleton,sort=nearest] store result entity @s Health float 1 run scoreboard players get @s Health

The Wither Skeleton stops being able to get to the survival mode player when those 2 commands are active.
This didn't effect Zombies.
I didn't try other mobs.

I asked people to confirm that this is not only happening on my Windows 10 PC.
And it appears to be a bug in the code instead of my installation.

How to reproduce

  1. Enter the following command into a powered, repeating command block:

    data merge entity @e[type=wither_skeleton,limit=1,sort=nearest] {Test:0}
  2. Spawn a wither skeleton:

    /summon wither_skeleton
  3. Switch to survival mode:

    /gamemode survival

    → ❌ The wither skeleton has trouble pathfinding to you

Linked issues

Attachments

Comments 6

Confirmed in 1.16.1 and 20w29a. It seems the issue here is that modifying a wither skeleton's NBT resets its pathfinding, hence it can be reproduced using a single repeating command:

data merge entity @e[type=wither_skeleton,limit=1,sort=nearest] {Test:0}

Only wither skeletons targeting a player (or another entity) are affected. Their wandering AI still functions correctly, and mobs other than wither skeletons don't appear to be affected at all.

I can confirm this too. (In 1.16.1 and 20w29a)

Can confirm in 20w51a.

Can confirm in 21w06a.

Can confirm in 21w07a. Video attached.

Can confirm in 1.16.5 and 21w08b.

Benjaming Ivanka Bloigu

(Unassigned)

Confirmed

Platform

Low

Commands, Mob behaviour

Minecraft 1.14, Minecraft 1.14.2, 1.14.4, 1.15.1, 1.16.1, ..., 21w20a, 22w43a, 1.19.4, 1.20.4, 24w06a

Retrieved