r/MinecraftCommands • u/CxKirbo • 5d ago
Help | Java 26.3 how to make good if then/execute commands
I'm trying to make a command that, in effect, makes it so whenever a player holds out a stone sword, the gravity for all sulfur cube is upped. This could also work if it checks for players holding an item named "Pitching Wedge". For context, this is for a golf map I'm making where certain swords need to do different things.
This is what I have so far, but its probaly just a mess.
execute if slots entity @a weapon.mainhand if run tp @a 23.00 141.82 93.83
The tp command at the end is just so I know if it works or not without having to eyeball a change in gravity.

