HiddenGifts
将你的 Hytale 服务器变成一场寻宝之旅。管理员可以在世界任意位置隐藏一个宝箱,玩家在探索时会收到距离提示,第一个找到宝箱的玩家可以获得分层级战利品——全程向服务器实时广播。
功能
- 管理员放置的宝藏箱 — 使用
/hiddengift place 随机生成一个层级,或使用 /hiddengift place rare 指定层级
- 接近通知 — 玩家进入隐藏宝箱一定范围时会收到提示通知
- 分层级奖励系统 — 包含普通、稀有和传说三个层级,采用加权随机选择,每个层级可配置物品池和数量范围
- 全服公告 — 放置和发现过程通过事件标题、提示通知和聊天消息广播
- 不可破坏的宝箱 — 礼物宝箱不能被玩家破坏或损坏
- 发现冷却 — 防止同一玩家连续领取(可配置持续时间)
- 完全可配置 — 所有层级、物品、消息、范围、冷却时间以及宝箱方块 ID 均可在
config.json 中修改
工作原理
- 管理员在看向某个方块时运行
/hiddengift place [层级]
- 该方块上方出现一个宝箱,服务器收到通知:宝藏已被隐藏
- 探索世界的玩家在靠近宝箱时会收到接近提示
- 第一个走到宝箱前的玩家领取战利品 — 物品直接进入背包
- 所有人都能看到是谁找到了宝藏、什么层级以及赢得了什么
命令
| 命令 |
权限 |
描述 |
/hiddengift place [层级] |
hiddengifts.place |
隐藏一个礼物宝箱(随机或指定层级) |
/hiddengift remove |
hiddengifts.place |
移除当前活动的礼物 |
/hiddengift stats |
所有玩家 |
查看你的总发现次数 |
依赖
PlayerData-Core(必需)— 追踪每位玩家的发现统计和冷却时间。HiddenGifts 前必须先安装并加载此模组。
安装
- 安装 PlayerData-Core
- 将 HiddenGifts 的
.jar 文件放入服务器的 plugins 文件夹
- 启动服务器 — 会自动生成默认的
config.json
- 编辑
config.json 以自定义层级、奖励和消息
配置指南
插件首次运行时会在数据文件夹中生成 config.json 文件。以下是对每项设置的说明。
常规设置
| 键 |
类型 |
默认值 |
描述 |
hintRadius |
整数 |
30 |
玩家必须距离隐藏宝箱多近(以方块为单位)才会收到接近提示通知。范围:5–200。 |
finderCooldownMinutes |
整数 |
10 |
找到宝藏后,玩家必须等待多少分钟才能再次领取。设置为 0 可禁用。范围:0–1440。 |
placerCanClaim |
布尔值 |
false |
放置宝箱的管理员是否也能自己领取。 |
chestBlockId |
字符串 |
"Furniture_Christmas_Chest_Small" |
世界中可见宝箱所使用的方块 ID。可以是任何有效的 Hytale 方块或家具 ID。 |
层级系统
层级在 "tiers" 键下以映射的形式定义。每个层级名称(例如 "common"、"rare"、"legendary")对应一个层级对象。你可以自由添加、删除或重命名层级。
层级对象
| 键 |
类型 |
描述 |
weight |
整数 |
随机放置时该层级被选中的概率。数值越高,出现频率越高。权重为 60 的层级被选中的概率是权重为 10 的层级的 6 倍。 |
pickCountMin |
整数 |
从该层级池中发放的最小物品数量。 |
pickCountMax |
整数 |
发放的最大物品数量。实际数量在最小和最大之间随机生成。上限为池中物品数量。 |
items |
数组 |
可能的奖励物品池(见下文)。 |
物品对象(位于 items 数组内)
| 键 |
类型 |
描述 |
item |
字符串 |
要发放的 Hytale 物品 ID(例如 "Ingredient_Bar_Iron"、"Tool_Pickaxe_Cobalt")。 |
min |
整数 |
发放该物品的最小数量。 |
max |
整数 |
最大数量。在最小和最大之间随机生成。将两者设为相同值可获得固定数量。 |
层级选择原理
假设权重为:普通: 60,稀有: 30,传说: 10(总计 = 100):
- 普通 — 约 60% 的概率被选中
- 稀有 — 约 30% 的概率被选中
- 传说 — 约 10% 的概率被选中
奖励生成原理
示例:一个稀有层级,pickCountMin: 2,pickCountMax: 3,池中有 4 个物品:
- 在 2 到 3 之间随机生成一个数字 → 例如 3
- 从池中随机抽取 3 个物品
- 对每个抽取的物品,在其
min 和 max 之间随机生成数量
消息
所有显示文本均可配置。使用下方所示的占位符 — 它们会在运行时被替换。
放置消息(宝箱被隐藏时向全服显示)
| 键 |
默认值 |
占位符 |
messageHiddenPlaced |
"A {tier} treasure has been hidden somewhere in the world!" |
{tier} — 层级名称 |
messagePlacedToast |
"Treasure Hidden!" |
— |
messagePlacedToastHint |
"A {tier} gift is waiting to be found!" |
{tier} — 层级名称 |
接近消息(向宝箱附近的单个玩家显示)
| 键 |
默认值 |
占位符 |
messageProximityToast |
"Treasure Nearby!" |
— |
messageProximityHint |
"You sense a hidden treasure nearby..." |
— |
发现广播(有人找到宝藏时向全服显示)
| 键 |
默认值 |
占位符 |
messageFoundTitle |
"{player} Found It!" |
{player} |
messageFoundSubtitle |
"A {tier} treasure has been claimed!" |
{tier} |
messageFoundToast |
"{player} found a hidden treasure!" |
{player} |
messageFoundToastHint |
"They claimed the {tier} reward!" |
{tier} |
messageFoundChat |
"--- {player} found a {tier} treasure! ---" |
{player}、{tier} |
messageRewardFormat |
"Reward: {reward}" |
{reward} — 格式化后的奖励列表 |
个人反馈(仅向发现者显示)
| 键 |
默认值 |
占位符 |
messagePersonalFoundTitle |
"Treasure Found!" |
— |
messagePersonalFoundToast |
"Reward Collected!" |
— |
messagePersonalFoundChat |
"+ {reward} added to your inventory!" |
{reward} |
messagePersonalFoundStats |
"Total treasures found: {found}" |
{found} — 累计发现次数 |
冷却消息(当处于冷却状态的玩家接近宝箱时显示)
| 键 |
默认值 |
占位符 |
messageCooldownToast |
"On Cooldown" |
— |
messageOnCooldown |
"You found one recently! Wait {minutes} minutes." |
{minutes} |
其他消息(用于命令)
| 键 |
默认值 |
占位符 |
messageNoGiftActive |
"No hidden gift is currently active." |
— |
messageAlreadyActive |
"A hidden gift is already active!" |
— |
messageStats |
"You have found {found} hidden treasures!" |
{found} |
完整默认配置
{
"hintRadius": 30,
"finderCooldownMinutes": 10,
"placerCanClaim": false,
"chestBlockId": "Furniture_Christmas_Chest_Small",
"tiers": {
"common": {
"weight": 60,
"pickCountMin": 1,
"pickCountMax": 2,
"items": [
{ "item": "Ingredient_Bar_Iron", "min": 2, "max": 5 },
{ "item": "Ingredient_Bar_Copper", "min": 3, "max": 8 }
]
},
"rare": {
"weight": 30,
"pickCountMin": 2,
"pickCountMax": 3,
"items": [
{ "item": "Ingredient_Bar_Cobalt", "min": 1, "max": 3 },
{ "item": "Tool_Pickaxe_Iron", "min": 1, "max": 1 }
]
},
"legendary": {
"weight": 10,
"pickCountMin": 3,
"pickCountMax": 5,
"items": [
{ "item": "Tool_Pickaxe_Cobalt", "min": 1, "max": 1 },
{ "item": "Weapon_Sword_Iron", "min": 1, "max": 1 }
]
}
},
"messageHiddenPlaced": "A {tier} treasure has been hidden somewhere in the world!",
"messagePlacedToast": "Treasure Hidden!",
"messagePlacedToastHint": "A {tier} gift is waiting to be found!",
"messageProximityHint": "You sense a hidden treasure nearby...",
"messageProximityToast": "Treasure Nearby!",
"messageFoundTitle": "{player} Found It!",
"messageFoundSubtitle": "A {tier} treasure has been claimed!",
"messageFoundToast": "{player} found a hidden treasure!",
"messageFoundToastHint": "They claimed the {tier} reward!",
"messageFoundChat": "--- {player} found a {tier} treasure! ---",
"messageRewardFormat": "Reward: {reward}",
"messagePersonalFoundTitle": "Treasure Found!",
"messagePersonalFoundToast": "Reward Collected!",
"messagePersonalFoundChat": "+ {reward} added to your inventory!",
"messagePersonalFoundStats": "Total treasures found: {found}",
"messageCooldownToast": "On Cooldown",
"messageOnCooldown": "You found one recently! Wait {minutes} minutes.",
"messageNoGiftActive": "No hidden gift is currently active.",
"messageAlreadyActive": "A hidden gift is already active!",
"messageStats": "You have found {found} hidden treasures!"
}
正在加载评论…
评论在新手盒子客户端中发表,这里同步展示。