Minecraft Execute Command Generator

Most broken commands are broken selectors, not broken syntax. Build the /execute if entity condition here with explicit filters, and test it with a harmless command before wiring it to something that damages, kills or teleports.

Read the matching guide

Java 26.2

/execute if entity

If Entity@e[type=minecraft:zombie,limit=1]
Distance
x rotation
y rotation
Team
Name
XP Level

/execute if entity

Wrap a command behind an entity selector condition.

/execute if entity @e[type=zombie,limit=1] run say matched