# 计分板

## 关于

带有 SIDEBAR（侧边栏） 显示槽的计分板目标。

## 启用

打开 **config.yml** 并找到这一部分

```
scoreboard:
  enabled: false
  toggle-command: /sb
  remember-toggle-choice: false
  hidden-by-default: false
  use-numbers: false
  static-number: 0
  delay-on-join-milliseconds: 0
  respect-other-plugins: true
  disable-in-worlds: 
    - disabledworld
```

要启用该功能，请设置

```
scoreboard:
  enabled: true
```

## 创建一个计分板

计分板可以在配置文件的 `scoreboards` 部分设置。你可以创建无限多的计分板。每个计分板可以有一个条件要求，玩家必须满足条件要求才能看到计分板。如果没有满足，下一个配置的计分板将会被继续检查，以此类推。如果最后一个计分板玩家仍不满足条件，那么玩家将不会看到计分板。

每个计分板可以由 3 个部分组成。:

### title

计分板的标题。

### lines

最大 15 行文本。你也可以配置更多，但是客户端不会显示。

**注意:** 空白行将会被隐藏。如果你想要计分板的一行不显示任何内容，请使用 `" "` 。

### display-condition

一个要显示该计分板必须满足的条件。如果玩家没有满足，将会检查下一个计分板。&#x20;

## 规则

在配置超过 1 个计分板后，插件将会根据条件要求为玩家显示计分板。每个计分板的条件要求将会配置的从上到下依次检查，直到玩家能够满足的第一个计分板。总而言之，插件将会直接跳过玩家不满足的计分板，直到第一个满足的计分板。如果没有计分板满足，那么没有计分板会被显示。

## 公告指令

公告的计分板将会覆盖原来的计分板，当公告结束后，原来的计分板将会恢复。\
`/tab announce scoreboard <name> <time>`\
name - 公告计分板的名称。\
time - 公告计分板显示的时间，以秒为单位。

## 附加设置

### 开关计分板

`toggle-command: /sb`\
玩家开关计分板的指令。玩家需要 `tab.scoreboard.toggle` 权限才能使用它。\
**注意:** 这个指令不会在指令自动补充框中出现，因为它不是一个真正注册的指令。注册的指令必须在插件中就已经决定好，不能动态修改。如果你想要解决这个问题，请自行定制插件。

`remember-toggle-choice: false`\
如果启用，切换计分板的指令偏好将会保存。玩家在重新加入、服务器重启等后依然保留该偏好。

`hidden-by-default: false`\
如果启用，记分牌将在加入时自动隐藏，直到使用切换命令显示它。

### 数字

`use-numbers: false`\
如果启用，将会在计分板左侧显示 1-15 数字，如果禁用，将会显示 `static-number` 的数字。

`static-number: 0`\
如果 use-numbers 禁用，所有行都会显示该数字。

### 其他

`delay-on-join-milliseconds: 0`\
在玩家加入服务器多久后显示计分板，以毫秒为单位。

`respect-other-plugins: true`\
如果启用，其他插件如果发送计分板，TAB会自动隐藏自己的计分板，这样其他插件的计分板就可以正常显示了。

## 在指定世界、服务器禁用

```
scoreboard:
  disable-in-worlds:
    - disabledworld
  disable-in-servers:
    - disabledserver
```

要在除了所列的世界外禁用，只需添加 `WHITELIST` 关键词到列表中，这回导致该功能只会在所列的世界中启用。示例：

```
scoreboard:
  disable-in-worlds:
    - WHITELIST
    - enabledworld
```

**注意**: 在指定服务器关闭只能在 BungeeCord 上使用，并且还需安装 [TAB-Bridge](https://www.mc-market.org/resources/21641) 插件到所有子服上。

## 限制

* 在 1.13 以下版本，计分板的标题限制在 32 个字符以内(包括颜色代码)。
* 在 1.13 以下版本，计分板每行限制在 26 个字符以内(包括颜色代码)。
* 最多只能显示 15 行。
* 计分板右侧的红色数字在插件层面无法删除，你需要额外安装 Mod。（PS: 资源包也可以)

## 示例

### 示例 1 - 分世界计分板

我们将会根据 "等于号" (=) 的条件判别来检查 `%world%` 变量符。如果条件符合（即世界为你设置的世界），在指定世界的计分板将会显示给玩家。如果没有，那么会继续检查下一个计分板。如果没有计分板符合要求，那么将会显示 default（默认）计分板。

```
scoreboard:
  scoreboards:
    # start
    scoreboard1:
      display-condition: "%world%=world1"
      title: 'Scoreboard 1'
      lines:
      - 'You are in world world1'
    # first condition didn't pass, try next
    scoreboard2:
      display-condition: "%world%=world2"
      title: 'Scoreboard 2'
      lines:
      - 'You are in world world2'
    # first two conditions didn't pass, try next
    scoreboard3:
      display-condition: "%world%=world3"
      title: 'Scoreboard 3'
      lines:
      - 'You are in world world3'
    # none of the conditions above passed, display default scoreboard
    default:
      title: 'Default scoreboard'
      lines:
      - 'You are not in any of the worlds listed above'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.superiormc.cn/tab-wiki/core-features/ji-fen-ban.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
