mojira.dev
MC-297188

/damage with custom damage types always causes knockback

When using two identical damage types, with identical .json files, say “minecraft:generic” and “custom:generic”, using the /damage command to trigger said damage type will NOT cause knockback with the inbuilt minecraft damage type (intended behaviour).

However, the custom damage type, given through the /damage command, WILL cause knockback to the damaged player, in a random direction, despite the JSON for these two damage types being identical and the command used to trigger them being identical.

JSON (in both cases):

{
"exhaustion": 0.0,
"message_id": "generic",
"scaling": "when_caused_by_living_non_player"
}

COMMANDS:

damage @s 1 minecraft:generic → no knockback (as intended)

damage @s 1 custom:generic → causes knockback

Environment

Occurs in all environments.

Comments 1

minecraft:generic is in the minecraft:no_knockback tag, while your custom:generic damage type is not.

kklein

(Unassigned)

Unconfirmed

(Unassigned)

1.21.5

Retrieved