Denizen Script Commands


Commands are always written with a '-' before them, and are the core component of any script, the primary way to cause things to happen.
Learn about how commands work in The Beginner's Guide.


Showing 1 out of 184 commands...
NameScoreboard
Syntaxscoreboard ({add}/remove) (viewers:<player>|...) (lines:<player>/<text>|...) (id:<value>/player/{main}) (objective:<value>) (criteria:<criteria>/{dummy}) (score:<#>) (displayslot:<value>/{sidebar}/none) (displayname:<name>) (rendertype:<type>)
Short DescriptionAdd or removes viewers, objectives and scores from scoreboards.
Full DescriptionLets you make players see a certain scoreboard and then a certain objective in that scoreboard.
Please note that a 'scoreboard' is NOT a 'sidebar' - if you want that thing where text is on the right side of the screen, use Command:sidebar.
'Scoreboard' is the underlying internal system that powers sidebars, below_name plates, team prefixing, and a lot of other systems. Generally, you should avoid using this command directly.

The ID can be 'main' for the global default scoreboard, 'player' for the attached player's current scoreboard, or any other value for a custom named scoreboard.

There are currently three slots where objectives can be displayed:
in the sidebar on the right of the screen, below player names and in the player list that shows up when you press Tab.
The names of these slots can be found here: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/scoreboard/DisplaySlot.html

Every objective has several lines of scores.
Technically, the lines track players, but fake player names can be used by Denizen to let you call the lines anything you want.

When using the sidebar as the display slot, all the scores set for an objective will be displayed there,
but you will need to put actual player names in the lines to be able to use
the below_name display slot (which displays each player's score underneath his/her name) and
the player_list display slot (which displays each player's score to the right of his/her name in the player list).

If you do not specify a display slot, the sidebar will be used. You can also use "none" as the
display slot if you want to add a hidden objective without automatically making it get displayed.
If the object already exists, and you don't specify the display slot, it will use the existing setting.

When setting an objective, you can also optionally set the display name by using the "displayname:" argument.

"Rendertype" can be "INTEGER" or "HEARTS". Defaults to integer.

You can set scores manually, or you can use different Minecraft criteria that set and update the scores automatically.
A list of these criteria can be found here: 🔗https://minecraft.wiki/w/Scoreboard#Objectives
If the object already exists, and you don't specify the criteria, it will use the existing setting.

You can use the "remove" argument to remove different parts of scoreboards.
The more arguments you use with it, the more specific your removal will be.
For example, if you only use the "remove" argument and the "id" argument, you will completely remove all the objectives in a scoreboard,
but if you specify an objective as well, you will only delete that one objective from that scoreboard,
and if you also specify certain lines, you will only delete those specific lines from that objective.
Similarly, if you use the "remove" argument along with the "id" and "viewers" arguments, you will only remove those viewers from the scoreboard, not the entire scoreboard.
Related Tags<server.scoreboard[(<board>)].exists> Returns whether a given scoreboard exists on the server.
<server.scoreboard[(<board>)].team[<team>].members> Returns a list of all members of a scoreboard team. Generally returns as a list of names or text entries. (...)
<PlayerTag.scoreboard_id> Returns the ID of the scoreboard from Command:scoreboard that a player is currently viewing, if any.
Usage Example
# Add a score for the defined player to the default scoreboard under the objective "cookies" and let him see it
- scoreboard add obj:cookies lines:joe score:1000 viewers:<[aplayer]>
Usage Example
# Add a new current objective called "food" to the "test" scoreboard with 3 lines that each have a score of 50:
- scoreboard add id:test obj:food lines:Cookies|Donuts|Cake score:50
Usage Example
# Make a list of players see the scoreboard that has the id "test":
- scoreboard add viewers:<[player]>|<[aplayer]>|<[thatplayer]> id:test
Usage Example
# Change the value of one of the scores in the "food" objective:
- scoreboard add id:test obj:food lines:Cake score:9000
Usage Example
# Remove one of the lines from the "food" objective in the "test" scoreboard
- scoreboard remove obj:food lines:Donuts
Usage Example
# Remove one of the viewers of the "test" scoreboard:
- scoreboard remove viewers:<[aplayer]>
Usage Example
# Make the defined player see the health of other players below their names
- scoreboard add viewers:<[player]> id:test obj:anything criteria:health displayslot:below_name
Usage Example
# Make all the players on the world "survival" see each other's number of entity kills in the player list when pressing Tab
- scoreboard add viewers:<world[survival].players> id:test obj:anything criteria:totalKillCount displayslot:player_list
Groupserver
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java#L34