Current Situation:
Right now, /function ... with only supports block, entity, and storage. These are useful, but it would be even more powerful if we could directly pass scoreboard values to functions.
Proposal:
Option 1:
Allow passing a single score:
/function demo:func with score <selector> <scoreboard> <name>
Inside the function, use:
$execute if score @p matches $(<name>) run ...
Option 2:
Allow passing multiple scores as a map:
/function demo:func with scores {<name>: {<selector>:<scoreboard>}, <name2>: {<selector>:<scoreboard>}}
Inside the function, use:
$execute as @a[scores={<scoreboard>=$(<name>)}] run give @s stick $(<name2>)
Why?
- Makes functions more dynamic and reusable
- Reduces the need for extra setup commands with passing scoreboard values to a storage or something or having a long selector again inside of the function
- Enables more advanced?, useful datapack logic. At least i believe so.
Please sign in to leave a comment.
0 Comments