Skip to content

Commit

Permalink
add tag <server.scoreboard[(<board>)].team_names>
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 10, 2020
1 parent d9632ea commit f71041b
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,21 @@ else if (recipe instanceof CookingRecipe<?>) {
}
}

// <--[tag]
// @attribute <server.scoreboard[(<board>)].team_names>
// @returns ListTag
// @description
// Returns a list of the names of all teams within the scoreboard.
// Optionally, specify which scoreboard to use.
// -->
if (attribute.startsWith("team_names")) {
ListTag result = new ListTag();
for (Team team : board.getTeams()) {
result.add(team.getName());
}
event.setReplacedObject(result.getObjectAttribute(attribute.fulfill(1)));
}

if (attribute.startsWith("team") && attribute.hasContext(1)) {
Team team = board.getTeam(attribute.getContext(1));
if (team == null) {
Expand Down

1 comment on commit f71041b

@pobab
Copy link
Contributor

@pobab pobab commented on f71041b Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot. it so helpfull 👍

Please sign in to comment.