I propose a new syntax for the `/function` command to directly integrate with the scoreboard system, making scores easily usable as variables. Currently, /function allows data sources like blocks, entities, or storage, but my suggestion simplifies this to /function <name> with scores <target>. This integration reduces the need for additional commands and intermediate steps. In this proposal, after 'with', the syntax is short for scoreboard players ... <target> which is how other /scoreboard commands are formatted. In the following macro function, the variable referenced is an objective, just like how the data structure of the /function command references a key.
Example:
function example:test with scores @s
# function example:test
$give @s diamond $(bank_money)
scoreboard players reset @s bank_money
I've been doing a lot of iterative processes in data packs lately, and iterating over stuff while you have to add to a scoreboard every time the macro function runs, would be a lot easier without have to save to one or multiple paths in storage first.
Please sign in to leave a comment.
3 Comments