The ability to create functions has been a great addition to the game. However it feels like there are some things missing with the functions command:
- The inability to have custom parameters
- The fact that you need op to run these commands
- And the fact that you have to use /function [function name] to run the command
With these in mind, I came up with an improved function system that solves these problems and lets you create custom commands similar to how you do with functions!
The command would be usable by members. The file name would still be the name of the command you want to create, but on the first line of the document you would put the parameters for the command in the order you want them. To reference a parameter you would just type '1' for the first parameter, '2' for the second one and so on. For example a /buy command would have a filename of buy.mcfunction with the contents:
string number
tag @s add '1'
execute @s[tag=wool,scores={money=10..}] ~ ~ ~ /scoreboard players remove @s money 10
execute @s[tag=wool,scores={money=10..}] ~ ~ ~ /give @s wool
execute @s[tag=planks,scores={money=15..}] ~ ~ ~ /scoreboard players remove @s money 10
execute @s[tag=planks,scores={money=15..}] ~ ~ ~ /give @s planks
execute @s[tag=!wool,tag=!planks] ~ ~ ~ /tellraw @s {"rawtext":[{"text":"§cThis item is not for sale"}]}
tag @s remove '1'
This would allow for the purchase of either wool or planks. Parameters could look like this:
player string number block item
Please sign in to leave a comment.
0 Comments