Introduction :
Have you ever tried to make a PvP game on your own world ? Or whatever that could be, when you were building that game you maybe encountered a problem. The problem is that, when a player is killed by an another player, you want to add a point to the scoreboard or this particuliar player. Yes, there are many solutions found to this problem but a command that allow us to do this directly is pretty convenient. So /deathcause is to verify if a player was killed by an another player and would work like an execute command, here is the prototype :
/deathcause <player: target> run [command] <deadplayer/killer>... Etc
/deathcause <player: target> run as <deadplayer/killer> [command] <player: target>...Etc
/deathcause <player: target> run at <deadplayer/killer> <position: xyz> [command] <player: target>...Etc
I will explain some parts of this command, <player: target> allow you to target a specific player, an entity, or just any player, if the target die, it verify if his/their death(s) was/were caused by an player. The <deadplayer/killer> is used to specify which player your want your action to be done. You can still use the basic targeting like "@s". An example, if you want to remove points to the player that was killed :
/deathcause @a run scoreboard players remove deadplayer test 1
Or summon a explosion when a player die :
/deathcause @a[tag=explosion] run at deadplayer ~~~ summon ender_crystal ~~~ minecraft:crystal_explode
You could use all commands with /deathcause!
Please sign in to leave a comment.
1 Comments