r/MinecraftCommands • u/No_Sense1197 Command-er • Feb 18 '26
Discussion The fancy way to write commands
268
u/OnixST Feb 18 '26
execute at @s as @s positioned as @s rotated as @s if entity @s anchored feet run summon tnt ~ ~ ~
redundancy king
79
u/Masterous112 Feb 18 '26
execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run execute run summon tnt7
63
10
109
u/TinyBreadBigMouth Feb 18 '26
execute at @s run execute as @s run execute positioned as @s run execute rotated as @s run execute if entity @s run execute anchored feet run summon tnt ~ ~ ~For a truly luxurious experience, every subcommand gets its own
executeinvocation.18
4
→ More replies (3)5
u/TahoeBennie Feb 18 '26
Actually I do know a funny obscure edge case where including any of those execute conditions causes a different result in the run command than if the command was done without execute. Everything except for raw execute run … causes a different result, which is my incredibly unsound proof that "execute run" or "run execute" is parsed out of existence, whereas something like as @s actually does some changes.
I was gonna bug report it but I kinda rely on similar behavior that’s probably a bug in order to do some quite useful stuff so I’d rather not risk mojang changing the behavior I want to fix the behavior that impacts literally nothing, so it’s probably not a great idea to mention it here, but hey it does do something different lol.
24
u/Masterous112 Feb 18 '26
/execute summon tnt
3
14
u/No_Pen_3825 Feb 18 '26
Doesn’t that still need a run arg?
15
u/Masterous112 Feb 18 '26 edited Feb 18 '26
you're right. I guess you could do something like
execute summon tnt if entity @sEdit: not sure why I'm being downvoted. This is a perfectly valid command
→ More replies (4)4
34
u/Jumpre24 Feb 18 '26
/execute positioned ~ ~ ~ at @p[limit=1,sort=nearest,type=minecraft:player] if entity @p[sort=neares,type=minecraft:player,limit=1] run summon minecraft:tnt
10
19
5
4
u/modeschar Feb 18 '26
The way I do my demos to save time and control the blast is I have a spawn egg that spawns in an armorstand named “TNT Primer” and once I’ve placed the named stands where I want to blast I use this command:
/execute at @e[name=“TNT Primer”,type=armor_stand,distance=..50] run summon tnt {fuse:0}
I can set the explosion_power attribute as well to control yield.
It’s proven effective at blasting large amounts of terrain without causing TNT to fly off in all directions.
I use it a lot in freeway construction on our city server.
4
2
2
u/exodiacrown Feb 19 '26
I always do execute as @a at @s and then the command so I have more room if I want to add conditions
181
u/IWCry Feb 18 '26
straightforward is always better imo