diff --git a/docs/scarpet/Full.md b/docs/scarpet/Full.md index 2ff8e83c..20369350 100644 --- a/docs/scarpet/Full.md +++ b/docs/scarpet/Full.md @@ -4175,8 +4175,83 @@ for the objective. ### `scoreboard_display(place, objective)` -sets display location for a specified `objective`. If `objective` is `null`, then display is cleared. If objective is invalid, +Sets display location for a specified `objective`. If `objective` is `null`, then display is cleared. If objective is invalid, returns `null`. + +# Team + +### `team_list()`, `team_list(team)` + +Returns all available teams as a list with no arguments. + +When a `team` is specified, it returns all the players inside that team. If the `team` is invalid, returns `null`. + +### `team_add(team)`, `team_add(team,player)` + +With one argument, creates a new `team` and returns its name if successful, or `null` if team already exists. + + +`team_add('admin')` -> Create a team with the name 'admin' +`team_add('admin','Steve')` -> Joing the player 'Steve' into the team 'admin' + +If a `player` is specified, the player will join the given `team`. Returns `true` if player joined the team, or `false` if nothing changed since the player was already in this team. If the team is invalid, returns `null` + +### `team_remove(team)` + +Removes a `team`. Returns `true` if the team was deleted, or `null` if the team is invalid. + +### `team_leave(player)` + +Removes the `player` from the team he is in. Returns `true` if the player left a team, otherwise `false`. + +`team_leave('Steve')` -> Removes Steve from the team he is currently in +`for(team_list('admin'), team_leave('admin', _))` -> Remove all players from team 'admin' + +### `team_property(team,property,value?)` + +Reads the `property` of the `team` if no `value` is specified. If a `value` is added as a third argument, it sets the `property` to that `value`. + +* `collisionRule` + * Type: String + * Options: always, never, pushOtherTeams, pushOwnTeam + +* `color` + * Type: String + * Options: See [team command](https://minecraft.gamepedia.com/Commands/team#Arguments) (same strings as `'teamcolor'` [command argument](https://github.com/gnembon/fabric-carpet/blob/master/docs/scarpet/Full.md#command-argument-types] options)) + +* `displayName` + * Type: String or FormattedText, when querying returns FormattedText + +* `prefix` + * Type: String or FormattedText, when querying returns FormattedText + +* `suffix` + * Type: String or FormattedText, when querying returns FormattedText + +* `friendlyFire` + * Type: boolean + +* `seeFriendlyInvisibles` + * Type: boolean + +* `nametagVisibility` + * Type: String + * Options: always, never, hideForOtherTeams, hideForOwnTeam + +* `deathMessageVisibility` + * Type: String + * Options: always, never, hideForOtherTeams, hideForOwnTeam + +Examples: + +``` +team_property('admin','color','dark_red') Make the team color for team 'admin' dark red +team_property('admin','prefix',format('r Admin | ')) Set prefix of all players in 'admin' +team_property('admin','display_name','Administrators') Set display name for team 'admin' +team_property('admin','seeFriendlyInvisibles',true) Make all players in 'admin' see other admins even when invisible +team_property('admin','deathMessageVisibility','hideForOtherTeams') Make all players in 'admin' see other admins even when invisible +``` + # Auxiliary aspects Collection of other methods that control smaller, yet still important aspects of the game