Minecraft – kill @p causes kill @e

minecraft-commandsminecraft-java-edition

I've started making a puzzle parkour map, where if you get a question wrong, you die. I have the player go through a slime bounce contraption to land on a pressure plate. The pressure plate then activates a command block (kill @p) and kills the player. However, it is killing ALL entities on my map! This was very frustrating, and I had to do my map without entities after that. After that I was messing around with the /detect ... kill @p and that killed me and all entities as well! Does anyone knows what is going on, or if I have to change a gamerule or something?

Thanks.

Best Answer

/kill @e[type=Player]

Make sure to use square brackets!