Minecraft – How to kill a certain entity in minecraft

minecraft-java-edition

I am making a Minecraft map. When you stand on a pressure plate, a squid has to die. The squid is at position [831, 65, -232].

Best Answer

To kill your squid, if its exactly in that coordinate, use

/kill @e[type=Squid,x=831,y=65,z=-232,r=0]

This will kill all squids that are at the coordinates 831,65,-232 with a range of 0. The range of 0 means that only the squids on that coordinate will be killed.


To be a little more secure, use this command:

/kill @e[type=Squid,x=831,y=65,z=-232,r=0,c=1]

This will only kill the nearest squid that is on the coordinates 831,65,-232 with a maximum range of 0 so only the squid that is on that coordinate is killed.