With the new addition of Function Macros, we can have variables, something commands usually have, it's a good opportunity to add custom commands!
{
"command": "jump", #command name /jump
"function": "ns:function", #function to run on command
"variables": {
"required": [ #required variables
{
"0": {
"name": "selector_variable",
"type": "selector",
"limit": 1 #if limit is provided, selector must only detect up to the maximum limit of entities
},
"1": {
"name": "text_variable",
"type": "text"
},
"2": {
"name": "num_variable",
"type": "number"
}
}
],
"optional": [ #optional variables
{
"0": {
"name": "obj_variable",
"type": "object"
}
}
]
},
"op": false, #if true, overrides the whitelist and blacklist, making it for op only, default false
"whitelist": [ #list of usernames and teams that can use command
"username",
"#team"
],
"blacklist": [ #list of usernames and teams that can't use command
"username",
"#team"
],
"priority": 10 #the higher the number, the bigger the priority, in case it overrides vanilla commands or other datapack commands
}
Examples:
/jump <@selector_variable> <text_variable> <num_variable> [<obj_variable>]
/jump @a "jump!" 5
/jump @a "jump!" 5 {"key":"value"}
then function uses them like ${text_variable}
Please sign in to leave a comment.
0 Comments