scoreboard API

This commit is contained in:
gnembon committed 2020-03-25 00:32:00 -03:00
1 parent 7b21674f5b
commit ba96b1b034
4 files changed
+140 -11

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
# Scoreboard
### `scoreboard()`, `scoreboard(objective)`, `scoreboard(objective, key)`, `scoreboard(objective, key, value)`
Displays or modifies individual scoreboard values. With no arguments, returns the list of current objectives.
With specified `objective`, lists all keys (players) associated with current objective. With specified `objective`,
`key`, returns current value of the objective for a given player (key). With additional `value` sets a new scoreboard
value, returning previous value associated with the `key`.
### `scoreboard_add(objective, criterion?)`
Adds a new objective to scoreboard. If `criterion` is not specified, assumes `'dummy'`. Returns `false` if objective
already existed, `true` otherwise.
<pre>
scoreboard_add('counter')
scoreboard_add('lvl','level')
</pre>
### `scoreboard_remove(objective)`
Removes an objective. Returns `true` if objective has existed and has been removed.
### `scoreboard_display(objective, place)`
sets display location for a specified `objective`. If `place` is `null`, then display is cleared.