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.
minecraft:generic
is in theminecraft:no_knockback
tag, while yourcustom:generic
damage type is not.