[1.17.1] Change: Apply thorns damage instead of generic damage
James103 opened this issue ยท 3 comments
https://github.com/kwpugh/mining_Dimensions-1.17/blob/c181b6fd420e1c7e7a1468de7194c9c79c03adee/src/main/java/com/kwpugh/mining_dims/mixin/ZombieEntityMixin.java#L61
https://github.com/kwpugh/mining_Dimensions-1.17/blob/c181b6fd420e1c7e7a1468de7194c9c79c03adee/src/main/java/com/kwpugh/mining_dims/mixin/PiglinBruteEntityMixin.java#L56
Based on the above code samples, the damage applied is generic damage, which produces the death message "Player died [because of Zombie]" instead of what I think would be the correct death message of "Player was killed trying to hurt Zombie".
When I try this, I get "... was killed by Zombie" and "...was slain by Piglin brute".
Thorns is not one of the defined DamageSources in vanilla. Thorns is actually a method, that also sets it as magic use, which could create unintended results for my purposes.
These are the vanilla constants I work with:
After a bunch of testing, I only ever get the [player name] was killed by [mob name], which is what I would want.