Distinct Damage Descriptions

Distinct Damage Descriptions

7.9k Downloads

All death messages are duplicated in chat

James103 opened this issue ยท 8 comments

commented

As of Distinct Damage Descriptions 1.0.0-beta for MC 1.12.2, when you die, the death message appears twice in chat and 4 times in log (expected: once in chat and 2x in log unless you die twice to the same cause).

Example: When a player is crushed by a falling anvil, expected output:

Player was crushed by a falling anvil

Actual output:

Player was crushed by a falling anvil
Player was crushed by a falling anvil

commented

Did you have custom death messages turned on?

commented

I did not have custom death messages turned on when I first encountered this. I then successfully reproduced this with custom death messages turned on, which resulted in the same problem.

commented

Huh... so if the gamerule showDeathMessages is false, it still does two death messages? I would've though one would have been from Minecraft and one from DDD. Maybe there's more to this then. Either that or some small lapse in program logic when I added the custom death messages.

commented

Also, when a wolf dies with custom death messages turned on, the game outputs (when a Vindicator kills the wolf), regardless of the custom death messages setting:

[11:24:23] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]Damage Type: mob Attacker: minecraft:vindication_illager, True Attacker: minecraft:vindication_illager Defender: minecraft:wolf
[11:24:23] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]Damage Categories: (slashing: 4.200000, piercing: 0.000000, bludgeoning: 2.800000)
[11:24:23] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]starting damage: 7.0
[11:24:23] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]Damage Total: (4.2000003, null, 2.8)
[11:24:23] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]new damage after physical deductions: 7.0
[11:24:23] [Client thread/INFO] [minecraft/GuiNewChat]: [CHAT] Wolf was slain by Vindicator
[11:24:23] [Client thread/INFO] [minecraft/GuiNewChat]: [CHAT] Wolf was slain by Vindicator
[11:24:23] [Client thread/INFO] [minecraft/GuiNewChat]: [CHAT] Wolf died
commented

If you're running experiments on this, then could you try with custom damage types turned on? The default JSON enables counts Spiders as a custom damage type, so you could try using those mobs and seeing what happens (both with custom death messages on and off). I'm expecting to at least see

Spider made an example of Wolf

and

Wolf was slain by Spider

commented

I let a Spider kill me (player) instead of a Wolf, resulting in the following (anonymized) output:

[11:35:55] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]Damage Type: mob Attacker: minecraft:spider, True Attacker: minecraft:spider Defender: null
[11:35:55] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]Damage Categories: (slashing: 0.000000, piercing: 2.000000, bludgeoning: 0.000000)
[11:35:55] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]starting damage: 2.0
[11:35:55] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]Damage Total: (null, 2.0, null)
[11:35:55] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]new damage after physical deductions: 1.9992
[11:35:55] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]Damaging ItemArmor by: 1
[11:35:55] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]minecraft:spider, minecraft:spider
[11:35:55] [Server thread/INFO] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS (DEBUG)]ddd_example, ddd_normal
[11:35:55] [Server thread/INFO] [minecraft/MinecraftServer]: Spider made an example of Player
[11:35:55] [Server thread/INFO] [minecraft/MinecraftServer]: Player was slain by Spider
[11:35:55] [Client thread/INFO] [minecraft/GuiNewChat]: [CHAT] Spider made an example of Player
[11:35:55] [Client thread/INFO] [minecraft/GuiNewChat]: [CHAT] Player was slain by Spider

The output for when a Spider kills a Wolf is the same, except there's the additional line "Wolf died" and the player name in the death messages is replaced with "Wolf".

In other words, regardless of if custom damage types / custom death messages are enabled, it's printing the death message resulting from the custom damage type, then the death message resulting from the underlying vanilla damage type, then (for some mobs) the generic death message.

commented

Hmmm, this was my initial thought. Probably just a slight oversight.

commented

I believe commit 8e13ad0 actually resolves this. Adding

Will prevent the messages from popping up when custom death messages are disabled. When custom death messages are enabled, a world restart is required and that sets the showDeathMessages gamerule to false.