# **NBContest**
**NBContest** 是一个轻量级、快速且高度可定制的 Minecraft 插件,允许您举办服务器范围内的激动人心的竞赛,例如耕种、钓鱼和狩猎怪物等活动。它鼓励玩家竞争并获得可配置的奖励。
---
## ✨ 特性
- **耕种竞赛** – 破坏一种随机作物(例如小麦、胡萝卜等)
- **钓鱼竞赛** – 尽可能多地钓鱼!
- **温顺生物竞赛** – 杀死牛、鸡、羊驼等!
- **敌对生物竞赛** – 杀死僵尸、骷髅等敌对生物!
- **实时 HUD**:
- 显示时间和全球目标的 BossBar(支持 MiniMessage)
- 显示个人玩家得分的 ActionBar (完全可用的解决方法)
- **前 3 名奖励** 系统通过命令执行
- **自动事件调度器** 通过 `config.yml`:
- 支持每个事件多个时间(例如,在 14:00、18:30 开始耕种)
- 完全可定制时区(例如,欧洲/巴黎)
- 基于服务器时钟,每天自动运行
- 通过 `messages.yml` 完全可翻译(MiniMessage 就绪)
- 轻量级且针对性能进行了优化
---
## ⌨️ 命令
| 命令 | 描述 | 权限 |
|--------|-------------|------------|
| `/nbcontest start ` | 开始一个竞赛(`farming`、`fishing`、`hostiles_mobs`、`passive_mobs`) | `nbcontest.admin` |
| `/nbcontest stop` | 停止当前的竞赛 | `nbcontest.admin` |
| `/nbcontest reload` | 重新加载配置、调度和语言 | `nbcontest.admin` |
---
## 🕒 自动事件
可以使用 `auto-events` 在 config 中安排自动事件。每个事件可以有多个开始时间,所有时间都基于服务器的时区。
您可以使用 `timezone: Europe/Paris` (或任何支持的 ID) 配置时区。
---
## ⚙️ 配置 (`config.yml`)
```yaml
duration: 300 # 所有事件的持续时间(秒)
# 时区 ID 列表 (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
timezone: "Europe/Paris"
auto-events:
enabled: true
farming:
- "14:00"
- "18:30"
fishing:
- "15:00"
hostiles_mobs:
- "16:00"
passive_mobs:
- "17:00"
bossbar:
color: YELLOW # 选项: PINK, BLUE, GREEN, RED, YELLOW, PURPLE, WHITE
# 竞赛配置
objective:
fixed: false
amount: 100
min: 50
max: 500
# 竞赛使用的方块类型
farming:
block-types:
- WHEAT
- POTATOES
- CARROTS
- BEETROOTS
- PUMPKIN
- MELON
- SUGAR_CANE
- COCOA_BEANS
- NETHER_WART
# 奖励(最多前 3 名玩家)
rewards:
farming:
top1: 'give %player% minecraft:diamond 5'
top2: 'give %player% minecraft:emerald 10'
top3: 'give %player% minecraft:bread 32'
fishing:
top1: 'give %player% minecraft:trident 1'
top2: 'give %player% minecraft:cod 16'
top3: 'give %player% minecraft:salmon 16'
hostiles_mobs:
top1: 'give %player% minecraft:netherite_ingot 1'
top2: 'give %player% minecraft:iron_sword 1'
top3: 'give %player% minecraft:shield 1'
passive_mobs:
top1: 'give %player% minecraft:golden_apple 3'
top2: 'give %player% minecraft:cooked_beef 32'
top3: 'give %player% minecraft:leather 16'
```
---
## 💬 消息 (`messages.yml`)
```yaml
contest-started: "[NBContest] The %event% contest has started!"
contest-ended: "[NBContest] The contest has ended!"
no-participants: "No players participated in this contest."
top-title: "Top 5 Players:"
top-line: "#%rank% %player% - %score% %unit%"
farming-objective: "Goal: Break %amount% %material%"
bossbar.farming: "Time: %time%s - %remaining% %material% left"
bossbar.generic: "Time: %time%s"
# 不要为 actionbar 使用 MiniMessage,因为它不支持颜色代码 (临时解决方法)
actionbar.farming: "&e%score% &f%material% harvested"
actionbar.fishing: "&e%score% &ffish caught"
actionbar.mobs: "&e%score% &fmobs killed"
event:
farming: "Harvesting"
fishing: "Fishing"
hostiles_mobs: "Monster Hunt"
passive_mobs: "Culling"
unit:
fishing: fish caught
hostiles_mobs: mobs killed
passive_mobs: mobs killed
materials:
WHEAT: wheat
POTATOES: potatoes
CARROTS: carrots
BEETROOTS: beetroot
PUMPKIN: pumpkins
MELON: melons
SUGAR_CANE: sugar cane
COCOA_BEANS: cocoa beans
NETHER_WART: nether wart
```
---
## 🧩 占位符用法
这些占位符用于消息和奖励中:
- `%event%` – 事件名称 (翻译)
- `%material%` – 目标材料
- `%amount%` – 目标数量
- `%score%` – 玩家分数
- `%player%` – 玩家姓名
- `%unit%` – 显示单位(例如,怪物杀死了)
- `%time%` – 剩余时间(以秒为单位)
- `%remaining%` – 剩余的方块或实体数量
- `%rank%` – 排行榜中的玩家排名
---
## 🛠 插件设置
1. 将 `NBContest.jar` 放在您的 `/plugins` 文件夹中。
2. 重新启动服务器或使用 `/reload`。
3. 如需定制,请修改 `config.yml` 和 `messages.yml`。
4. 使用 `/nbcontest start ` 开始竞赛或依赖于自动调度器。
---
## 📸 截图


---
## ❤️ 鸣谢
由 **6rius** ❤️ 创建
加入我们的 [Discord](https://discord.com/invite/sRuEqP6Bxs) 以获得支持、建议或问题。