2
Help! How To Create Custom Commands???
Hi I Wana Know How To Create A Custom Command With Out Any Mod Or Plugin
3
You cannot create commands in vanilla. There is something called functions that allows you to create like commands, but without parameters. If you mean these ultra-long commands that create a command block machine, they are not actuallt new commands and since 1.13 we use data packs instead, which are overall better.
You can also use trigger scoreboard objectives for commands with a numerical parameter that are available also to "no cheats" players.
You can also use trigger scoreboard objectives for commands with a numerical parameter that are available also to "no cheats" players.
If you're trying to create a datapack (a creation that consists of commands) you can try the tutorial blog series I made.
If you want to create an actual command (like /gamemode), it's only possible using "/scoreboard objectives add <obj> trigger" and then a loop that does "/scoreboard players enable <obj> <player>". After enabling, the players can do "/trigger <obj> [(add|set) <amount>]" to set a score on the objective.
On a loop you can then use "@a[scores={<obj>=<amount min>..<amount max>}]" to target the players that ran the /trigger command. Make sure to reset their scores to prevent running the previous command multiple times: "/scoreboard players reset <see above> <obj>"
Usually people use books or chat to create clickable text that then executes /trigger commands. It looks a bit better than having to manually do "/trigger obj"
If you want to create an actual command (like /gamemode), it's only possible using "/scoreboard objectives add <obj> trigger" and then a loop that does "/scoreboard players enable <obj> <player>". After enabling, the players can do "/trigger <obj> [(add|set) <amount>]" to set a score on the objective.
On a loop you can then use "@a[scores={<obj>=<amount min>..<amount max>}]" to target the players that ran the /trigger command. Make sure to reset their scores to prevent running the previous command multiple times: "/scoreboard players reset <see above> <obj>"
Usually people use books or chat to create clickable text that then executes /trigger commands. It looks a bit better than having to manually do "/trigger obj"
What kind of commands do you want to create?
