mojira.dev
MC-259790

/damage can provide fewer variables to death message than expected, printing unformatted message

The bug:

Some damage type death messages expect two variables for the translation: one for the victim and one for the killer. In vanilla, this always works fine, but with /damage, it's possible to deal damage of this type without a killer. In this case, due to the recent changes to out of bounds variables, the message is printed without any variable substitution.

How to reproduce:

/damage @s 30 fireball
  • Prints "%1$s was fireballed by %2$s"

Expected result:

  • The message should output either: "[username] was fireballed by a command" or "[username] was fireballed by %2$s"

Linked issues

Attachments

Comments 7

/damage @s 100 thrown also causes missing messages.

@LakeJason

 

The message output for that would be "[player] was pummeled by [player/entity]"

 

I think that exact message didn't load properly.

You're not providing the variables the death message requests, as such they are missing. Since a prior snapshot, out of bounds variables are no longer empty strings and print the variable marker instead.

What makes you expect it to print "intentional game design"? That's not set in the damage type file, so it shouldn't print that.

I know, but the weird thing is that the first entity/player in the message should output the player's username, however, it doesn't do that.

The second one might always display those "variable markers", most likely because it was triggered by a command, not another player/entity/projectile.

 

I said that the symbols will print if no "by" argument is used.

 

Btw: Thanks for the feedback!

Here's a full table of affected damage types and their corresponding displayed death messages.

Damage Type

Death Message

minecraft:arrow

%1$s was shot by %2$s

minecraft:fireball

%1$s was fireballed by %2$s

minecraft:indirect_magic

%1$s was killed by %2$s using magic

minecraft:mob_attack
minecraft:mob_attack_no_aggro
minecraft:mob_projectile
minecraft:player_attack

%1$s was slain by %2$s

minecraft:player_explosion

%1$s was blown up by %2$s

minecraft:thorns

%1$s was killed trying to hurt %2$s

minecraft:thrown

%1$s was pummeled by %2$s

minecraft:trident

%1$s was impaled by %2$s

minecraft:wither_skull

%1$s was shot by a skull from %2$s

Updated it due to ugly format XD

I can confirm in 23w44a

SeaGlowingPro

(Unassigned)

Confirmed

Platform

Normal

Commands, Text

command, death-message

23w06a, 23w07a, 1.19.4 Pre-release 1, 1.19.4 Pre-release 2, 1.19.4 Pre-release 3, ..., 1.20.4, 24w14a, 1.21.1, 24w36a, 1.21.8 Release Candidate 1

Retrieved