TransWikia.com

this command should to execute if the player stands in this specific location, but it doesn't do anything

Arqade Asked by Yuuri on June 22, 2021

If you stand in x=129 – 132, y=121 – 124, z=154 – 155, this command should kill you, but it doesn’t do anything. what is wrong with this command? I tried with an "always active" command block, and i tried it with a regular command block with an active lever next to it, but either way nothing happens.

execute as @p[x=-129,y=121,z=-154,dx=-132,dy=123,dz=-155] run kill @p

I am in a singleplayer world in Minecraft 1.16.5 with Forge and Optifine installed.

One Answer

The execute only runs for the nearest player to the command block, so you need to use the @a selector and @s for killing.

The bounding box selector works with a position and positive dx, dy, and dz values. dx, dy, and dz are differences of x, y, and z.

So the following runs at all players, if their bounding box is in x=129..132, y=121..124, z=154..155, and kills them.

execute as @a[x=129,y=121,z=154,dx=3,dy=3,dz=1] run kill @s

You can put this command in a repeat, unconditional, always active command block at the spawn chunks.

Answered by sourrabbit on June 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP