Only a command with at least one function field takes part in the update
passes: a command whose fields are all values or plugin.when conditions is
registered once and evaluated again only when Command.set changes it.
The Shuffle item carries a check mark while the plugin's own shuffle
is on and is always enabled. A function is evaluated again in every full
update pass (after each handler); only changes are sent, and a plain
value never changes. A state of the player is a plugin.when
condition instead, which the player evaluates itself.
let shuffle = false;
plugin.commands.add({
id: "shuffle",
path: ["Playback", "Shuffle"],
checked: () => shuffle, // re-evaluated after the handler
enabled: true, // a fixed value
run: () => void (shuffle = !shuffle),
});
A value, or a function the SDK re-evaluates on every full update pass, and after a player state change only if it read a field of
plugin.player.statethat changed (see Scope.update); only changes are sent to the player.