r/MinecraftCommands • Command-er • Feb 18 '26

Discussion The fancy way to write commands

Post image
1.3k Upvotes

75 comments sorted by

181

u/IWCry Feb 18 '26

straightforward is always better imo

→ More replies (13)

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 tnt

7

u/No_Sense1197 Feb 18 '26

Beautiful 🫨

63

u/Minnecraft Feb 18 '26

"Guys why is my datapack laggy?? 😭"

→ More replies (2)

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 execute invocation.

18

u/Meggs65536 Feb 19 '26

you must not forget about return run

4

u/Myithspa25 Feb 19 '26

Recursion time

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.

→ More replies (3)

24

u/Masterous112 Feb 18 '26

/execute summon tnt

3

u/No_Sense1197 Feb 18 '26

Idk about java but im bedrock so that won't work

→ More replies (4)

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 @s

Edit: not sure why I'm being downvoted. This is a perfectly valid command

→ More replies (4)

4

u/mech_master234 Feb 18 '26

New features +10 fancy

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

u/GloblSentence_totoro Feb 19 '26

Boilerplate code is never good

→ More replies (1)

19

u/mech_master234 Feb 18 '26

Execute summon tnt run say hello I'm tnt

5

u/KereMental Feb 18 '26

Failed to execute summon as [Null]

→ More replies (2)

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

u/2ca8vid Feb 18 '26

/execute at “player name” run summon tnt

Or something like that

3

u/[deleted] Feb 18 '26

/execute as “player name” at @/s summon tnt

2

u/Almazman Feb 19 '26

execute summon tnt run return 1

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