In the earlier versions of Minecraft there was the testfor command, is there a similar command that also works in the 1.16 snapshots?
/ execute if…
E.g. / execute if entity @e [type = cow, distance = .2]
And what does it do?
Will the player be killed when he is in the area?
Nothing, in my example it tests whether a cow is within a radius of 2 blocks and then outputs yes or no like the Testfor command
If you want a player to be killed, this is the best way to do it:
/ execute as @a [distance = .2] run kill @s
it just says "test failed"
it only says "test failed"
/execute if entity @a[distance=.5] run kill @a If a player is within 5 blocks of command run, kill ALL players. Fun
hey! i just found your question and i was wondering same. so here is what i found: execute if entity @e[dx=, dy=, dz=] run kill @e[type=!player, type=!item, dx=, dy=, dz=] this command kill any entity in a specified range (dx, dy, an dz, it goe fram the command block to the specified block) exept item and player) execute if entity @e[dx=, dy=, dz=] this part of the command detect if there is any entity in selected range. You can specify which entity by adding: "type=" between "[" and "dx" and you can add as much entity specs as you want. as usual, use "type=!player" to not aim player (replace player by any entity to not target other entity) hope it helps