Closed dirthsj closed 8 years ago
Sadly there isn't an easy way to check that an objective has been changed: I'd have to loop through every player/objective combination to see which ones have changed. It is probably easier to handle this on the Lua end. If you use commands.async.*
functions you can ensure there is only a 1 tick delay.
From the Lua side, it's actually rather annoying. The only way to identify the value is
commands.scoreboard( "players test", playerName, objectiveName, lower, upper )
...which is tedious if you have, for example, 100 different values. You can cut the number of commands down by doing halves (is it between 1 & 50, 1-25, etc.), but you're still guessing. Even if you can't detect when the scoreboard has changed, it'd be great if you could add something to get the value directly (that way I could simply test if it's non-nil).
@KingofGamesYami I've opened another issue (#105) with some command related stuff. Feel free to add anything else: though I don't just want to recreate OpenPeripheral's sensor.
The trigger command is used to set or increment a trigger scoreboard objective. It's only accessible to non-players unless explicitly allowed. In fact, it has to be re-allowed each time they use it, as demonstrated by commenting out line 30 of my CC-Jam 2016 project.
As for the event it would fire, I imagine it would look something like this: