Optimizing scoreboard API with scoreboard_property (#753)

* Adding scoreboard_property, deprecating scoreboard_remove

* Docs

* Editor keywords

* Whoops

* adding scoreboard_remove back

* Making rendertype snake case

* Double scoreboard_remove

* Removed deprecation
This commit is contained in:
replaceitem authored and GitHub committed 2021-03-14 03:12:29 -03:00
1 parent e81f3d9629
commit 15c5c8753f
4 files changed
+101 -12

No files matched your search

+11 -3
View File
@@ -6,13 +6,12 @@ Displays or modifies individual scoreboard values. With no arguments, returns th
With specified `objective`, lists all keys (players) associated with current objective, or `null` if objective does not exist.
With specified `objective` and
`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`.
value, returning previous value associated with the `key`. If the `value` is null, resets the scoreboard value.
### `scoreboard_add(objective, criterion?)`
Adds a new objective to scoreboard. If `criterion` is not specified, assumes `'dummy'`.
If the objective already exists, changes the criterion of that objective and returns `false`. If the criterion was not specified but the objective already exists, returns the current criterion.
If the objective was added, returns `true`. If nothing is affected, returns `null`
Returns `true` if the objective was created, or `null` if an objective with the specified name already exists.
Throws `unknown_criterion` if criterion doesn't exist.
@@ -33,6 +32,15 @@ for the objective.
Sets display location for a specified `objective`. If `objective` is `null`, then display is cleared. If objective is invalid,
returns `null`.
### `scoreboard_property(objective, property)` `scoreboard_property(objective, property, value)`
Reads a property of an `objective` or sets it to a `value` if specified. Available properties are:
* `criterion`
* `display_name` (Formatted text supported)
* `display_slot`: When reading, returns a list of slots this objective is displayed in, when modifying, displays the objective in the specified slot
* `render_type`: Either `'integer'` or `'hearts'`, defaults to `'integer'` if invalid value specified
# Team
### `team_list()`, `team_list(team)`
@@ -97,6 +97,7 @@ scoreboard
scoreboard_add
scoreboard_remove
scoreboard_display
scoreboard_property
tag_matches
team_add
team_leave
@@ -62,7 +62,7 @@
display_title
scoreboard scoreboard_add scoreboard_remove scoreboard_display
scoreboard scoreboard_add scoreboard_remove scoreboard_display scoreboard_property
team_add team_list team_remove team_leave team_property