mojira.dev
MC-269104

OnGround NBT tag is not set to 1/true for a tick when spawning entities on the ground

When an entity spawns directly on the ground, the "OnGround" NBT tag isn't set to true for a brief moment. Consequently, entities like parrots and chickens briefly flap their wings upon spawning, and mobs that are immediately damaged after spawning won't experience vertical knockback. To test the knockback issue, you can utilize the command

execute as @p run damage @e[type=!minecraft:player,sort=nearest,limit=1] 1 minecraft:player_attack by @s

in a repeating command block, although it's possible to reproduce the issue without this command. This behavior is related to MC-190551.

Attachments

Comments 2

steps to reproduce

  1. Put the following command in an activated repeating command block:

    execute as @p at @s run damage @e[type=!minecraft:player,sort=nearest,limit=1] 1 minecraft:player_attack by @s
  2. Spawn a mob

Observed: The mob did not experience vertical knockback upon first being damaged due to {OnGround:0}.

Expected: The mob should also experience vertical knockback upon first being damaged.

Also affects 24w14a.

oowooglac

No User

(Unassigned)

Community Consensus

Platform

Low

(Unassigned)

1.20.4, 24w09a, 24w10a, 24w11a

Retrieved