Hi! Im creating a map and I needed to find how to detecte the death of a player betwen to player, and say the name of the last player in the arena. I knew its possible because I finded a map that can catch name and detect player names but I didn't understand how did he do. (he ised.like a summon whit many thinks).
So what I would do is assign each player to a room before your game starts. You can use the set spawn point command to set the spawn point for those players to each of those rooms. Have it so that upon returning to he room you can use the title command or a command block to say that the player has died. Finally when all the players are dead you can use the title command again to detect who is in the arena and display their name.
/title @e[type=player,x=Xmin,y=Ymin,z=Zmin,dx=xArea,dy=yArea,dz=zArea] <rest of command here>
Just make sure that the entire arena is cleared of any other player and that the player falls within the area of those coordinates. (Go to the minimum coordinate and count up to get your dx, dy, and dz values.)
Final note: This is for Bedrock which is what I assume you are on. If you are on Java I would just use scoreboard. Also this doesn't allow for custom messages like "Player x killed Player y" but You can say things like "Player x has fallen" and "Player y is victorious"
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi! Im creating a map and I needed to find how to detecte the death of a player betwen to player, and say the name of the last player in the arena. I knew its possible because I finded a map that can catch name and detect player names but I didn't understand how did he do. (he ised.like a summon whit many thinks).
Somebody can help me?
Should be able to.
So what I would do is assign each player to a room before your game starts. You can use the set spawn point command to set the spawn point for those players to each of those rooms. Have it so that upon returning to he room you can use the title command or a command block to say that the player has died. Finally when all the players are dead you can use the title command again to detect who is in the arena and display their name.
/title @e[type=player,x=Xmin,y=Ymin,z=Zmin,dx=xArea,dy=yArea,dz=zArea] <rest of command here>
Just make sure that the entire arena is cleared of any other player and that the player falls within the area of those coordinates. (Go to the minimum coordinate and count up to get your dx, dy, and dz values.)
Final note: This is for Bedrock which is what I assume you are on. If you are on Java I would just use scoreboard. Also this doesn't allow for custom messages like "Player x killed Player y" but You can say things like "Player x has fallen" and "Player y is victorious"