Enhanced UHC
-# 本文本来自我的 GitHub 仓库,请勿寻求任何关于 Maven 构建的帮助。
适用于 Minecraft Paper 服务器的 UHC 插件。它涵盖了完整的比赛生命周期:
配置、场景、队伍、散点分布、计时器、边界、统计信息、计分板、
Discord 公告以及比赛结束。
功能
- UHC 比赛管理:玩家散点分布、倒计时、最终治疗、PvP 激活、
限时下界访问、渐进式边界、延迟散点分布、2分钟重连宽限期以及获胜者宣布。
- FFA(自由混战)和团队模式,支持邀请、队伍聊天、不完整队伍的跨队合并、踢出、离开和解散。
- 用于配置和场景管理的管理员 GUI。
- 专用的
uhc 和 uhc_nether 世界,具备自动创建、配置的边界、
中心 PvP 清理以及内部预生成或 Chunky 集成。
- 可动态切换的场景:CutClean、Timber、FlowerPower、Randomizer、
NoFall、SafeMining、Bowless、TimeBomb、Golden Head、SafeLoot 等。
- 可配置计分板,包含比赛、队伍、边界和免打扰占位符,
以及名称下方的生命值和吸收指示器。
- 游戏内控制:苹果/燧石掉落率、蜘蛛网限制、药水、爆炸物、
防燃烧掉落、成就、隐藏命令和白名单状态。
- 可选的 TAB 列表格式化和 Lunar Client Apollo TeamView 集成。
- 持久化 MySQL 统计信息:击杀、死亡、助攻、胜利、游戏场次、
积分、Elo 评分以及排行榜。
- 通过 Webhook 或机器人 + 目标频道发送 Discord 开场和结果公告。
- 可选 MiniPlaceholders 支持,以暴露统计信息和比赛数据。
要求
| 组件 |
版本 / 说明 |
| Java |
21 |
| Maven |
推荐 3.9+ |
| 服务器 |
Paper 1.21.x (api-version: 1.21) |
| 数据库 |
可选 MySQL,在 database.yml 中默认启用 |
| 可选插件 |
MiniPlaceholders, TAB, Apollo, Chunky, WorldEdit / FastAsyncWorldEdit |
该插件基于 paper-api:1.21.11-R0.1-SNAPSHOT 编译。
构建
mvn clean package
生产环境的 jar 包将在 target/ 目录下生成,例如:
target/uhc-1.0.4-SNAPSHOT.jar
安装
- 使用 Maven 构建项目。
- 将 jar 文件放入 Paper 服务器的
plugins/ 目录。
- 启动服务器一次以在
plugins/UHC/ 中生成文件。
- 配置生成的 YAML 文件,然后重启服务器。
- 如果需要,使用
/pregen 预生成世界。
插件会自动创建并配置 uhc 和 uhc_nether 世界。
配置
| 文件 |
用途 |
uhc.yml |
计时器、队伍、边界、下界、掉落物、药水、散点分布、延迟散点分布、观察者出生点、游戏标志、标签页列表、边界墙和 Elo。 |
database.yml |
MySQL 连接、助攻窗口、排行榜大小和刷新间隔。 |
discordwebhook.yml |
Discord Webhook、机器人/频道目标、角色提及、开场和胜利嵌入。 |
scoreboard.yml |
计分板标题、目标和单人/团队行。 |
joinitems.yml |
大厅中给予的物品。 |
guis.yml |
界面标签和槽位。 |
items.yml |
自定义物品名称和描述。 |
messages.yml |
前缀和共享消息。 |
language.yml |
命令和监听器使用的可本地化文本。 |
plugin.yml |
命令、主权限以及 Bukkit/Paper 元数据。 |
默认情况下,database.yml 包含 mysql.enabled: true。如果没有可用的 MySQL 服务器,
请提供有效的凭据或将此值设置为 false。在内存模式下,
统计信息仅在当前会话中有效,不会持久保存。
命令
管理权限为 uhc.host,默认为 op。
管理
| 命令 |
描述 |
/start |
开始比赛,分散玩家,并开始计时器。 |
/finish <player> |
以某名玩家为获胜者结束比赛。 |
/finish team <id> |
以某支队伍为获胜者结束比赛。也接受 /finish team:<id> 格式。 |
/configurationAdmin |
打开管理员配置 GUI。 |
/scenariosadmin |
打开场景管理 GUI。 |
/pregen [radiusBlocks] [chunksPerTick] |
预生成 UHC 主世界和下界。 |
/pregen stop |
停止当前的预生成任务。 |
/announce <opening> |
发送 Discord 公告。接受的格式:16h01m、16h01min、16:01。 |
/hidden [player] |
为玩家应用匿名身份。 |
/hidden reset [player] |
恢复原始身份。 |
/statsadmin clear |
删除所有统计信息。 |
/statsadmin undo |
撤销上一场比赛的统计信息。别名:/statsadmin undolastgame。 |
/statsadmin get <player> |
显示玩家的统计信息。 |
/statsadmin add <player> <stat> <amount> |
向某项统计值添加数值。 |
/statsadmin remove <player> <stat> <amount> |
从某项统计值中移除数值。 |
/statsadmin set <player> <stat> <value> |
设置统计值。 |
/revive <player> |
复活一名玩家,并在可能时将其恢复到存活计数中。 |
/heal [player|all] |
治疗一名玩家、你自己或所有人。 |
/feed [player|all] |
恢复一名玩家、你自己或所有人的饥饿值。 |
/head <skin> [target] [amount] |
给予玩家头颅。 |
玩家
| 指令 |
说明 |
/team create |
在启用团队模式时创建一支队伍。 |
/team inv <player> |
邀请一名玩家加入。 |
/team invite <player> |
/team inv <player> 的别名。 |
/team accept |
接受邀请。 |
/team chat |
切换队伍聊天频道。 |
/team info |
显示队伍成员信息。 |
/team leave |
离开当前队伍。 |
/team kick <player> |
踢出一名队员,仅限队长操作。 |
/team disband |
解散队伍,仅限队长操作。 |
/crossteam <player> |
在游戏进行中合并两支存活但不完整的队伍。 |
/configuration |
打开公共配置图形界面(GUI)。 |
/scenarios |
显示当前激活的情景模式。别名:/scen、/scenario。 |
/kills [player] |
显示比赛击杀数。 |
/assists [player] |
显示比赛助攻数。 |
/fight |
广播你的位置以寻找战斗对手。 |
有用的别名:/party 对应 /team;/config 和 /cfg 对应 /configuration;/anonymous 和 /nick 对应 /hidden;/endgame 和 /forcewin 对应 /finish;/uhcstats、/statadmin、/statsmanage 对应 /statsadmin。
可用情景模式
| 情景模式 |
效果 |
| Bowless |
无法使用弓和弩。 |
| Chest |
死亡玩家的物品栏会被存入箱子中。 |
| Cobble Only |
非矿石洞穴方块掉落圆石。 |
| Cold Weapons |
禁用火焰附加和火元素附魔。 |
| CutClean |
矿石和食物直接掉落已烧炼状态。 |
| DoubleHealth |
玩家拥有 20 颗心(满血)。 |
| FlowerPower |
破坏花朵会掉落随机合法物品或战利品表奖励。 |
| Golden Head |
玩家死亡后掉落头颅,可制作成外观类似金苹果的金头(Golden Head)。其食用效果如同原版金苹果,并保留自定义的再生 III + 吸收效果。 |
| Hastey Boys |
镐子不可损坏且具有效率 III。 |
| Horseless |
玩家无法骑乘马匹。 |
| Maceless |
无法制作或使用重锤。 |
| NoClean |
击杀后获得 30 秒无敌时间。 |
| NoFall |
禁用摔落伤害。 |
| NoPoison |
阻止中毒效果。 |
| Randomizer |
方块和生物掉落物随机化为合法的生存物品。 |
| SafeLoot |
只有击杀者能在前 20 秒内打开死亡宝箱。 |
| SafeMining |
在挖掘阶段期间屏蔽伤害。 |
| Shieldless |
无法制作或使用盾牌。 |
| Spearless |
无法制作或使用长矛。 |
| Timber |
一次性破坏整棵树。 |
| TimeBomb |
死亡宝箱在 60 秒后爆炸。 |
MiniPlaceholders
如果安装了 MiniPlaceholders,uhc 扩展会自动注册。
玩家占位符:
kills, deaths, assists, wins, games_played, elo, elo_rank
match_kills, match_assists, team_kills
alive, elapsed_time, time_status, next_event, winner, mode
team, team_id, team_display, team_color
do_not_disturb_link, do_not_disturb_players, do_not_disturb_time
全局排行榜占位符:
top_kills_name, top_kills_value
top_deaths_name, top_deaths_value
top_assists_name, top_assists_value
top_wins_name, top_wins_value
top_games_played_name, top_games_played_value
top_elo_name, top_elo_value
排行榜占位符根据 MiniPlaceholders 语法接受排名参数。
比赛流程
- 使用
/configurationAdmin 和 /scenariosadmin 调整配置。
- 检查
uhc.yml,特别是 teams.size、计时器、边界以及下界设置。
- 使用
/pregen 预生成区块,或者如果安装了 Chunky 插件则让其自动处理。
- 让玩家通过
/team 创建队伍。
- 发送 Discord 公告:
/announce <opening>。
- 通过
/start 开始比赛。
- 游戏过程中,如需合并不完整的队伍,请使用
/crossteam <player>。
- 让胜利条件自动结束比赛,或通过
/finish 手动结束。
- 如果需要修正数据,使用
/statsadmin 管理统计数据。
项目结构
src/main/java/xyz/pyxismc/uhc/
commands/ Bukkit/Paper 命令
config/ UHC 配置加载
discord/ Discord 嵌入消息发送
game/ 比赛状态、世界、边界、队伍、比赛结束逻辑
gui/ 配置与情景模式界面
listeners/ 游戏玩法与配置监听器
scenarios/ 情景模式注册与激活
scoreboard/ 计分板与内部占位符
stats/ MySQL、缓存、排行榜、Elo 评级
utils/ 消息与语言辅助工具
发布验证
mvn clean package
然后在本地 Paper 服务器上测试生成的 jar 包,至少包含以下检查项:
- 插件启动无控制台错误;
- YAML 配置文件生成;
/configurationAdmin、/scenariosadmin、/pregen、/start 指令正常运作;
/crossteam、后期散开机制、重新连接宽限期、旁观者隐藏功能;
- 通过
/finish 结束比赛;
- 如果启用了 MySQL,统计数据的读取与写入功能正常。
Enhanced UHC
-# This text is from my github repositorie, avoid all the maven building help.
UHC plugin for Minecraft Paper servers. It covers the full match lifecycle:
configuration, scenarios, teams, scatter, timers, borders, statistics, scoreboard,
Discord announcements, and match ending.
Features
- UHC match management: player scatter, countdown, final heal, PvP activation,
timed Nether access, progressive borders, late scatter, 2-minute reconnect
grace, and winner announcement.
- FFA and team modes with invitations, team chat, cross-team merging for
incomplete teams, kick, leave, and disband.
- Admin GUIs for configuration and scenarios.
- Dedicated
uhc and uhc_nether worlds with automatic creation, configured borders,
center PvP cleanup, and internal pre-generation or Chunky integration.
- Dynamically toggleable scenarios: CutClean, Timber, FlowerPower, Randomizer,
NoFall, SafeMining, Bowless, TimeBomb, Golden Head, SafeLoot, and more.
- Configurable scoreboard with match, team, border, and Do Not Disturb placeholders,
plus a below-name health and absorption indicator.
- Gameplay controls for apple/flint rates, cobweb limits, potions, explosives,
anti-burn drops, achievements, hidden commands, and whitelist state.
- Optional TAB tablist formatting and Lunar Client Apollo TeamView integration.
- Persistent MySQL statistics: kills, deaths, assists, wins, games played,
points, Elo, and leaderboards.
- Discord announcements for openings and results through a webhook or bot + target channel.
- Optional MiniPlaceholders support for exposing statistics and match information.
Requirements
| Component |
Version / note |
| Java |
21 |
| Maven |
3.9+ recommended |
| Server |
Paper 1.21.x (api-version: 1.21) |
| Database |
Optional MySQL, enabled by default in database.yml |
| Optional plugins |
MiniPlaceholders, TAB, Apollo, Chunky, WorldEdit / FastAsyncWorldEdit |
The plugin is compiled against paper-api:1.21.11-R0.1-SNAPSHOT.
Build
mvn clean package
The production jar is generated in target/, for example:
target/uhc-1.0.4-SNAPSHOT.jar
Installation
- Build the project with Maven.
- Place the jar in the Paper server's
plugins/ directory.
- Start the server once to generate the files in
plugins/UHC/.
- Configure the generated YAML files, then restart the server.
- If needed, pre-generate the worlds with
/pregen.
The plugin automatically creates and configures the uhc and uhc_nether worlds.
Configuration
| File |
Purpose |
uhc.yml |
Timers, teams, borders, Nether, drops, potions, scatter, late scatter, spectator spawn, gameplay flags, tablist, border wall, and Elo. |
database.yml |
MySQL connection, assist window, leaderboard size, and refresh interval. |
discordwebhook.yml |
Discord webhook, bot/channel target, role mention, opening and victory embeds. |
scoreboard.yml |
Scoreboard title, objectives, and solo/team lines. |
joinitems.yml |
Items given in the lobby. |
guis.yml |
Interface labels and slots. |
items.yml |
Custom item names and lore. |
messages.yml |
Prefixes and shared messages. |
language.yml |
Localizable text used by commands and listeners. |
plugin.yml |
Commands, main permission, and Bukkit/Paper metadata. |
By default, database.yml contains mysql.enabled: true. If no MySQL server is
available, either provide valid credentials or set this value to false. In memory mode,
stats work for the current session but are not persisted.
Commands
The administration permission is uhc.host and defaults to op.
Administration
| Command |
Description |
/start |
Starts the match, scatters players, and starts timers. |
/finish <player> |
Ends the match with a player winner. |
/finish team <id> |
Ends the match with a team winner. Also accepts /finish team:<id>. |
/configurationAdmin |
Opens the admin configuration GUI. |
/scenariosadmin |
Opens the scenario administration GUI. |
/pregen [radiusBlocks] [chunksPerTick] |
Pre-generates the UHC Overworld and Nether. |
/pregen stop |
Stops the current pre-generation task. |
/announce <opening> |
Sends the Discord announcement. Accepted formats: 16h01m, 16h01min, 16:01. |
/hidden [player] |
Applies an anonymous identity to a player. |
/hidden reset [player] |
Restores the original identity. |
/statsadmin clear |
Deletes all statistics. |
/statsadmin undo |
Reverts statistics from the last match. Alias: /statsadmin undolastgame. |
/statsadmin get <player> |
Shows a player's statistics. |
/statsadmin add <player> <stat> <amount> |
Adds a value to a statistic. |
/statsadmin remove <player> <stat> <amount> |
Removes a value from a statistic. |
/statsadmin set <player> <stat> <value> |
Sets a statistic value. |
/revive <player> |
Revives a player and restores them to the alive counter when possible. |
/heal [player|all] |
Heals one player, yourself, or everyone. |
/feed [player|all] |
Restores food for one player, yourself, or everyone. |
/head <skin> [target] [amount] |
Gives a player head. |
Players
| Command |
Description |
/team create |
Creates a team if team mode is enabled. |
/team inv <player> |
Invites a player. |
/team invite <player> |
Alias for /team inv <player>. |
/team accept |
Accepts an invitation. |
/team chat |
Toggles team chat. |
/team info |
Shows team members. |
/team leave |
Leaves the current team. |
/team kick <player> |
Kicks a member, leader only. |
/team disband |
Disbands the team, leader only. |
/crossteam <player> |
Merges two alive incomplete teams during a running game. |
/configuration |
Opens the public configuration GUI. |
/scenarios |
Shows active scenarios. Aliases: /scen, /scenario. |
/kills [player] |
Shows match kills. |
/assists [player] |
Shows match assists. |
/fight |
Broadcasts your position when looking for a fight. |
Useful aliases: /party for /team, /config and /cfg for /configuration,
/anonymous and /nick for /hidden, /endgame and /forcewin for /finish,
/uhcstats, /statadmin, /statsmanage for /statsadmin.
Available Scenarios
| Scenario |
Effect |
| Bowless |
Bows and crossbows cannot be used. |
| Chest |
A dead player's inventory is stored in a chest. |
| Cobble Only |
Non-ore cave blocks drop cobblestone. |
| Cold Weapons |
Flame and Fire Aspect are disabled. |
| CutClean |
Ores and food directly drop smelted. |
| DoubleHealth |
Players have 20 hearts. |
| FlowerPower |
Breaking flowers drops a random legal item or loot-table reward. |
| Golden Head |
Players drop their head, craftable into a golden apple-looking Golden Head. It consumes like a vanilla golden apple and keeps the custom Regeneration III + Absorption effects. |
| Hastey Boys |
Pickaxes are unbreakable and have Efficiency III. |
| Horseless |
Players cannot mount horses. |
| Maceless |
Maces cannot be crafted or used. |
| NoClean |
Grants 30 seconds of invincibility after a kill. |
| NoFall |
Fall damage is disabled. |
| NoPoison |
Poison effect is blocked. |
| Randomizer |
Block and mob drops are randomized into legal survival items. |
| SafeLoot |
Only the killer can open a death chest for the first 20 seconds. |
| SafeMining |
Damage is blocked during the mining phase. |
| Shieldless |
Shields cannot be crafted or used. |
| Spearless |
Spears cannot be crafted or used. |
| Timber |
Breaks a whole tree at once. |
| TimeBomb |
Death chests explode after 60 seconds. |
MiniPlaceholders
If MiniPlaceholders is installed, the uhc expansion is registered automatically.
Player placeholders:
kills, deaths, assists, wins, games_played, elo, elo_rank
match_kills, match_assists, team_kills
alive, elapsed_time, time_status, next_event, winner, mode
team, team_id, team_display, team_color
do_not_disturb_link, do_not_disturb_players, do_not_disturb_time
Global leaderboard placeholders:
top_kills_name, top_kills_value
top_deaths_name, top_deaths_value
top_assists_name, top_assists_value
top_wins_name, top_wins_value
top_games_played_name, top_games_played_value
top_elo_name, top_elo_value
Leaderboard placeholders accept a rank argument according to MiniPlaceholders syntax.
Match Flow
- Adjust the configuration with
/configurationAdmin and /scenariosadmin.
- Check
uhc.yml, especially teams.size, timers, borders, and Nether settings.
- Pre-generate with
/pregen, or let Chunky handle it if the plugin is installed.
- Let players create teams with
/team.
- Send the Discord announcement with
/announce <opening>.
- Start the match with
/start.
- During the game, use
/crossteam <player> to merge incomplete teams if needed.
- Let victory conditions end the match automatically or end it manually with
/finish.
- Manage statistics with
/statsadmin if a correction is needed.
Project Structure
src/main/java/xyz/pyxismc/uhc/
commands/ Bukkit/Paper commands
config/ UHC configuration loading
discord/ Discord embed sending
game/ Match state, worlds, borders, teams, match ending
gui/ Configuration and scenario interfaces
listeners/ Gameplay and configuration listeners
scenarios/ Scenario registry and activation
scoreboard/ Scoreboard and internal placeholders
stats/ MySQL, cache, leaderboards, Elo
utils/ Message and language helpers
Release Verification
mvn clean package
Then test the jar on a local Paper server with at least:
- plugin startup without console errors;
- YAML file generation;
/configurationAdmin, /scenariosadmin, /pregen, /start;
/crossteam, late scatter, reconnect grace, and spectator hiding;
- match ending with
/finish;
- stats read/write if MySQL is enabled.
评论 0
登录后参与评分
还没有评论,来抢沙发吧