"""English templates for Minecraft 26.3 death chat components.""" DEATH_MESSAGE_TEMPLATES = { 'death.attack.anvil': '{0} was squashed by a falling anvil', 'death.attack.anvil.player': '{0} was squashed by a falling anvil while fighting {1}', 'death.attack.arrow': '{0} was shot by {1}', 'death.attack.arrow.item': '{0} was shot by {1} using {2}', 'death.attack.badRespawnPoint.message': '{0} was killed by {1}', 'death.attack.cactus': '{0} was pricked to death', 'death.attack.cactus.player': '{0} walked into a cactus while trying to escape {1}', 'death.attack.cramming': '{0} was squished too much', 'death.attack.cramming.player': '{0} was squashed by {1}', 'death.attack.dragonBreath': "{0} was roasted in dragon's breath", 'death.attack.dragonBreath.player': "{0} was roasted in dragon's breath by {1}", 'death.attack.drown': '{0} drowned', 'death.attack.drown.player': '{0} drowned while trying to escape {1}', 'death.attack.dryout': '{0} died from dehydration', 'death.attack.dryout.player': '{0} died from dehydration while trying to escape {1}', 'death.attack.even_more_magic': '{0} was killed by even more magic', 'death.attack.explosion': '{0} blew up', 'death.attack.explosion.player': '{0} was blown up by {1}', 'death.attack.explosion.player.item': '{0} was blown up by {1} using {2}', 'death.attack.fall': '{0} hit the ground too hard', 'death.attack.fall.player': '{0} hit the ground too hard while trying to escape {1}', 'death.attack.fallingBlock': '{0} was squashed by a falling block', 'death.attack.fallingBlock.player': '{0} was squashed by a falling block while fighting {1}', 'death.attack.fallingStalactite': '{0} was skewered by a falling stalactite', 'death.attack.fallingStalactite.player': '{0} was skewered by a falling stalactite while fighting {1}', 'death.attack.fireball': '{0} was fireballed by {1}', 'death.attack.fireball.item': '{0} was fireballed by {1} using {2}', 'death.attack.fireworks': '{0} went off with a bang', 'death.attack.fireworks.item': '{0} went off with a bang due to a firework fired from {2} by {1}', 'death.attack.fireworks.player': '{0} went off with a bang while fighting {1}', 'death.attack.flyIntoWall': '{0} experienced kinetic energy', 'death.attack.flyIntoWall.player': '{0} experienced kinetic energy while trying to escape {1}', 'death.attack.freeze': '{0} froze to death', 'death.attack.freeze.player': '{0} was frozen to death by {1}', 'death.attack.generic': '{0} died', 'death.attack.generic.player': '{0} died because of {1}', 'death.attack.genericKill': '{0} was killed', 'death.attack.genericKill.player': '{0} was killed while fighting {1}', 'death.attack.hotFloor': '{0} discovered the floor was lava', 'death.attack.hotFloor.player': '{0} walked into the danger zone due to {1}', 'death.attack.indirectMagic': '{0} was killed by {1} using magic', 'death.attack.indirectMagic.item': '{0} was killed by {1} using {2}', 'death.attack.inFire': '{0} went up in flames', 'death.attack.inFire.player': '{0} walked into fire while fighting {1}', 'death.attack.inWall': '{0} suffocated in a wall', 'death.attack.inWall.player': '{0} suffocated in a wall while fighting {1}', 'death.attack.lava': '{0} tried to swim in lava', 'death.attack.lava.player': '{0} tried to swim in lava to escape {1}', 'death.attack.lightningBolt': '{0} was struck by lightning', 'death.attack.lightningBolt.player': '{0} was struck by lightning while fighting {1}', 'death.attack.mace_smash': '{0} was smashed by {1}', 'death.attack.mace_smash.item': '{0} was smashed by {1} with {2}', 'death.attack.magic': '{0} was killed by magic', 'death.attack.magic.player': '{0} was killed by magic while trying to escape {1}', 'death.attack.mob': '{0} was slain by {1}', 'death.attack.mob.item': '{0} was slain by {1} using {2}', 'death.attack.onFire': '{0} burned to death', 'death.attack.onFire.item': '{0} was burned to a crisp while fighting {1} wielding {2}', 'death.attack.onFire.player': '{0} was burned to a crisp while fighting {1}', 'death.attack.outOfWorld': '{0} fell out of the world', 'death.attack.outOfWorld.player': "{0} didn't want to live in the same world as {1}", 'death.attack.outsideBorder': '{0} left the confines of this world', 'death.attack.outsideBorder.player': '{0} left the confines of this world while fighting {1}', 'death.attack.player': '{0} was slain by {1}', 'death.attack.player.item': '{0} was slain by {1} using {2}', 'death.attack.sonic_boom': '{0} was obliterated by a sonically-charged shriek', 'death.attack.sonic_boom.item': '{0} was obliterated by a sonically-charged shriek while trying to escape {1} wielding {2}', 'death.attack.sonic_boom.player': '{0} was obliterated by a sonically-charged shriek while trying to escape {1}', 'death.attack.spear': '{0} was speared by {1}', 'death.attack.spear.item': '{0} was speared by {1} using {2}', 'death.attack.stalagmite': '{0} was impaled on a stalagmite', 'death.attack.stalagmite.player': '{0} was impaled on a stalagmite while fighting {1}', 'death.attack.starve': '{0} starved to death', 'death.attack.starve.player': '{0} starved to death while fighting {1}', 'death.attack.sting': '{0} was stung to death', 'death.attack.sting.item': '{0} was stung to death by {1} using {2}', 'death.attack.sting.player': '{0} was stung to death by {1}', 'death.attack.sulfurCubeHot': '{0} died because not just the floor is lava', 'death.attack.sulfurCubeHot.item': '{1} showed {0} that not just the floor is lava using {2}', 'death.attack.sulfurCubeHot.player': '{1} showed {0} that not just the floor is lava', 'death.attack.sweetBerryBush': '{0} was poked to death by a sweet berry bush', 'death.attack.sweetBerryBush.player': '{0} was poked to death by a sweet berry bush while trying to escape {1}', 'death.attack.thorns': '{0} was killed while trying to hurt {1}', 'death.attack.thorns.item': '{0} was killed by {2} while trying to hurt {1}', 'death.attack.thrown': '{0} was pummeled by {1}', 'death.attack.thrown.item': '{0} was pummeled by {1} using {2}', 'death.attack.trident': '{0} was impaled by {1}', 'death.attack.trident.item': '{0} was impaled by {1} with {2}', 'death.attack.wither': '{0} withered away', 'death.attack.wither.player': '{0} withered away while fighting {1}', 'death.attack.witherSkull': '{0} was shot by a skull from {1}', 'death.attack.witherSkull.item': '{0} was shot by a skull from {1} using {2}', 'death.fell.accident.generic': '{0} fell from a high place', 'death.fell.accident.ladder': '{0} fell off a ladder', 'death.fell.accident.other_climbable': '{0} fell while climbing', 'death.fell.accident.scaffolding': '{0} fell off scaffolding', 'death.fell.accident.twisting_vines': '{0} fell off some twisting vines', 'death.fell.accident.vines': '{0} fell off some vines', 'death.fell.accident.weeping_vines': '{0} fell off some weeping vines', 'death.fell.assist': '{0} was doomed to fall by {1}', 'death.fell.assist.item': '{0} was doomed to fall by {1} using {2}', 'death.fell.finish': '{0} fell too far and was finished by {1}', 'death.fell.finish.item': '{0} fell too far and was finished by {1} using {2}', 'death.fell.killer': '{0} was doomed to fall', } def translate_death_message(translation, arguments, render_component): """Format a known death translation with its component arguments.""" template = DEATH_MESSAGE_TEMPLATES.get(translation) if template is None: return None values = [render_component(argument) for argument in arguments] try: return template.format(*values) except (IndexError, KeyError, ValueError): return None