Ohh Shiny
一款适用于 Minecraft Fabric 的模组,允许服务器管理员创建交互式、一次性的奖励点,玩家可通过在世界中右键点击方块来领取。
功能
- 互动奖励:在您的 Minecraft 世界中任意位置创建可领取的奖励地点
- 一次性领取:每位玩家对每个奖励仅能领取一次
- 视觉反馈:创建、移除和领取奖励时均有粒子特效
- 方块保护:奖励受到保护,防止被破坏
- 权限系统:完全集成 LuckPerms,实现精细的访问控制
- 持久化存储:所有奖励数据自动保存至磁盘
- 多维支持:可在任何维度(主世界、下界、末地、自定义维度)放置奖励
- 自定义物品:内置支持给予具有自定义纹理的玩家头颅(宝箱球和精灵球)
要求
- Minecraft:1.21.1
- Fabric Loader:0.17.2 或更高版本
- Fabric API:必需
- Fabric Language Kotlin:必需
- Java:21 或更高版本
- LuckPerms:可选(用于高级权限管理)
- TextPlaceholderAPI:可选(用于语言文件中的文本格式化)
安装
- 将 JAR 文件放入
mods 文件夹
- (可选)安装 LuckPerms 以实现高级权限管理
- (可选)安装 TextPlaceholderAPI 以进行文本格式化
- 启动服务器
用法
创建奖励
- 在主手中持有您希望作为奖励发放的物品
- 运行
/ohhshiny set 进入设置模式
- 右键点击任意方块以在该位置创建奖励
- 奖励将立即保存并可供玩家领取
注意:放置一个奖励后,设置模式会自动退出。若要放置另一个奖励,请再次运行 /ohhshiny set。
移除奖励
- 运行
/ohhshiny remove 进入移除模式
- 右键点击带有现有奖励的方块以删除它
- 该奖励及其所有相关的领取数据将被永久移除
注意:移除一个奖励后,移除模式会自动退出。
领取奖励
拥有领取权限的玩家只需右键点击带有奖励的任意方块即可:
- 如果此前未领取过,他们将获得奖励物品
- 如果已经领取过,他们会看到一条提示消息
- 如果该位置没有奖励,则执行正常的方块交互
管理命令
所有命令均需相应权限(请参阅下方的“权限”部分)。
/ohhshiny set
进入设置模式以创建新的奖励地点。
/ohhshiny remove
进入移除模式以删除现有的奖励地点。
/ohhshiny list
列出所有活跃的奖励地点及详细信息:
- 世界维度
- 坐标
- 奖励物品
- 已领取的玩家数量
- 可点击的传送链接,便于快速导航
/ohhshiny give chest <type>
给予具有自定义纹理的宝箱玩家头颅。
- 类型:
copper(铜)、iron(铁)、gold(金)
- 这些是特殊的物品,非常适合作为视觉上独特的奖励
/ohhshiny give pokeball <type>
给予具有自定义纹理的精灵球玩家头颅。
- 类型:
poke(普通球)、ultra(超级球)、master(大师球)
- 非常适合主题服务器或特殊活动
/ohhshiny reload
从磁盘上的配置文件重新加载所有奖励数据。
- 适用于应用手动编辑或从错误中恢复
- 显示已加载的奖励数量
/ohhshiny reloadlang
无需重启服务器即可重新加载语言文件 (lang.json)。
/ohhshiny reset <player>
重置特定玩家的领取历史,使其可以再次领取所有奖励。
/ohhshiny clearall
破坏性操作:永久删除所有奖励和领取数据。
- 需要确认(在 30 秒内连续运行两次该命令)
- 此操作不可撤销
- 请谨慎使用
权限
Ohh Shiny 使用 LuckPerms 进行权限管理。如果未安装 LuckPerms,所有命令默认需要操作员状态(等级 2+)。
可用权限
| 权限 |
描述 |
默认值 |
ohhshiny.base |
访问基础 /ohhshiny 命令 |
OP |
ohhshiny.claim |
通过右键点击方块领取奖励的能力 |
OP |
ohhshiny.set |
创建新的奖励地点 |
OP |
ohhshiny.remove |
删除现有的奖励地点 |
OP |
ohhshiny.list |
查看所有活跃的奖励地点 |
OP |
ohhshiny.give |
生成具有自定义纹理的物品 |
OP |
ohhshiny.reload |
从磁盘重新加载数据 |
OP |
ohhshiny.reset |
重置玩家的领取历史 |
OP |
ohhshiny.clearall |
删除所有奖励数据 |
OP |
权限示例
允许所有玩家领取奖励:
lp group default permission set ohhshiny.claim true
赋予版主除 clearall 之外的完整访问权限:
lp group moderator permission set ohhshiny.base true
lp group moderator permission set ohhshiny.claim true
lp group moderator permission set ohhshiny.set true
lp group moderator permission set ohhshiny.remove true
lp group moderator permission set ohhshiny.list true
lp group moderator permission set ohhshiny.give true
lp group moderator permission set ohhshiny.reload true
lp group moderator permission set ohhshiny.reset true
赋予管理员完全访问权限:
lp group admin permission set ohhshiny.* true
语言配置
所有消息均可通过语言文件完全自定义。该文件会在以下路径自动创建:
config/ohhshiny/lang.json
基本用法
编辑 lang.json 文件以自定义任何消息:
{
"prefix": "<aqua>[Ohh Shiny]</aqua>",
"loot.claimed": "<aqua>你发现了一些闪闪发光的东西:{item}!",
"error.already_claimed": "<red>你已经领取过这个了!"
}
编辑后,请使用以下命令重新加载:
/ohhshiny reloadlang
文本格式化
需要 TextPlaceholderAPI(可选,但推荐)。
颜色:
<red>、<green>、<blue>、<yellow>、<aqua>、<gold> 等。
- 十六进制颜色:
<#FF0000>
格式设置:
<bold>、<italic>、<underline>、<strikethrough>
高级功能:
- 渐变:
<gradient:blue:aqua>text</gradient>
- 彩虹色:
<rainbow>text</rainbow>
- 悬停提示:
<hover:'tooltip text'>hover me</hover>
占位符:
- 内置:
{x}、{y}、{z}、{item}、{player}、{count}
- TextPlaceholderAPI:
%player:name%、%server:tps% 等。
示例:
{
"prefix": "<gradient:aqua:blue><bold>[Ohh Shiny]</bold></gradient>",
"loot.claimed": "<rainbow>✨ You found: {item}! ✨</rainbow>"
}
数据存储
所有奖励数据均以 JSON 格式存储于以下路径:
config/ohhshiny/ohhshiny.json
该文件会在首次使用时自动创建,并在以下情况更新:
- 创建或删除奖励时
- 玩家领取奖励时
- 手动重新加载数据时
数据结构
每个奖励条目包含:
- 位置:维度及方块坐标
- 奖励物品:序列化物品数据(类型、数量、NBT 数据)
- 已领取玩家:已领取此奖励的玩家 UUID 列表
您可以手动编辑此文件,但请记住在之后运行 /ohhshiny reload 以应用更改。
许可证
本项目遵循 Apache License 2.0 许可证。详细信息请参阅 LICENSE 文件。
作者
支持
如需报告错误、提出功能请求或提问,请在项目仓库中提交 Issue。
性能
- 高效存储:基于 JSON 并自动保存
- 线程安全:在需要的地方使用并发数据结构
- 优化的粒子效果:在服务端 tick 中运行并进行距离检测
技巧与最佳实践
- 备份数据:在进行重大操作前,始终备份
config/ohhshiny/ohhshiny.json
- 使用自定义物品:内置的宝箱和精灵球头颅能让奖励更具视觉吸引力
- 策略性放置:将奖励放置在有趣或难以到达的位置
- 定期重载:如果手动编辑了 JSON 文件,请务必随后进行重载
- 权限层级:仅给予玩家所需的权限
- 测试:使用
/ohhshiny reset 在不创建新奖励的情况下进行测试
- 视觉反馈:粒子效果有助于让玩家知道他们发现了特殊物品
故障排除
玩家无法领取奖励
- 确认其拥有
ohhshiny.claim 权限
- 检查服务器日志中的权限错误
- 确保 LuckPerms 配置正确
奖励未保存
- 检查
config/ohhshiny 目录的文件权限
- 查看服务器控制台中是否有错误
- 尝试手动运行
/ohhshiny reload
重启后奖励消失
- 确保
ohhshiny.json 文件存在且未损坏
- 检查模组是否在启动过程中正确加载
- 验证没有其他模组干扰配置目录
粒子效果不显示
- 粒子效果会在服务端启动时自动加载(自 v1.1.0 起)
- 粒子效果仅对尚未领取奖励的玩家显示
- 粒子效果仅在玩家 16 格范围内渲染
- 如果粒子效果仍然不显示,请尝试运行
/ohhshiny reload
Ohh Shiny
A Minecraft Fabric mod that allows server administrators to create interactive, one-time reward points that players can claim by right-clicking blocks in the world.
Features
- Interactive Rewards: Create claimable reward locations anywhere in your Minecraft world
- One-Time Claims: Each reward can only be claimed once per player
- Visual Feedback: Particle effects for creating, removing, and claiming rewards
- Block Protection: Rewards are protected from being broken
- Permission System: Full LuckPerms integration for granular access control
- Persistent Storage: All reward data is automatically saved to disk
- Multi-Dimension Support: Place rewards in any dimension (Overworld, Nether, End, custom dimensions)
- Custom Items: Built-in support for giving custom textured player heads (chests and pokeballs)
Requirements
- Minecraft: 1.21.1
- Fabric Loader: 0.17.2 or newer
- Fabric API: Required
- Fabric Language Kotlin: Required
- Java: 21 or newer
- LuckPerms: Optional (for advanced permission management)
- TextPlaceholderAPI: Optional (for text formatting in language files)
Installation
- Place the JAR file in your
mods folder
- (Optional) Install LuckPerms for advanced permission management
- (Optional) Install TextPlaceholderAPI for text formatting
- Start your server
Usage
Creating Rewards
- Hold the item you want to give as a reward in your main hand
- Run
/ohhshiny set to enter setup mode
- Right-click on any block to create a reward at that location
- The reward is immediately saved and ready for players to claim
Note: Setup mode automatically exits after placing one reward. Run /ohhshiny set again to place another.
Removing Rewards
- Run
/ohhshiny remove to enter remove mode
- Right-click on a block with an existing reward to delete it
- The reward and all associated claim data are permanently removed
Note: Remove mode automatically exits after removing one reward.
Claiming Rewards
Players with claim permissions can simply right-click on any block that has a reward:
- If they haven't claimed it before, they receive the reward item
- If they've already claimed it, they see a message indicating they've already claimed it
- If no reward exists at that location, normal block interactions occur
Administrative Commands
All commands require appropriate permissions (see Permissions section below).
/ohhshiny set
Enters setup mode to create a new reward location.
/ohhshiny remove
Enters remove mode to delete an existing reward location.
/ohhshiny list
Lists all active reward locations with details:
- World dimension
- Coordinates
- Reward item
- Number of players who have claimed it
- Clickable teleport link for easy navigation
/ohhshiny give chest <type>
Gives a custom textured chest player head.
- Types:
copper, iron, gold
- These are special items perfect for use as visually distinctive rewards
/ohhshiny give pokeball <type>
Gives a custom textured pokeball player head.
- Types:
poke, ultra, master
- Great for themed servers or special events
/ohhshiny reload
Reloads all reward data from the configuration file on disk.
- Useful for applying manual edits or recovering from errors
- Shows the number of rewards loaded
/ohhshiny reloadlang
Reloads the language file (lang.json) without restarting the server.
- Apply message customizations immediately
- No server restart required
/ohhshiny reset <player>
Resets a specific player's claim history, allowing them to claim all rewards again.
- Useful for testing or special events
- Shows the number of claims reset
/ohhshiny clearall
DESTRUCTIVE: Permanently deletes all rewards and claim data.
- Requires confirmation (run the command twice within 30 seconds)
- This action cannot be undone
- Use with extreme caution
Permissions
Ohh Shiny uses LuckPerms for permission management. If LuckPerms is not installed, all commands default to requiring operator status (level 2+).
Available Permissions
| Permission |
Description |
Default |
ohhshiny.base |
Access to the base /ohhshiny command |
OP |
ohhshiny.claim |
Ability to claim rewards by right-clicking blocks |
OP |
ohhshiny.set |
Create new reward locations |
OP |
ohhshiny.remove |
Delete existing reward locations |
OP |
ohhshiny.list |
View all active reward locations |
OP |
ohhshiny.give |
Spawn custom textured items |
OP |
ohhshiny.reload |
Reload data from disk |
OP |
ohhshiny.reset |
Reset player claim histories |
OP |
ohhshiny.clearall |
Delete all reward data |
OP |
Permission Examples
To allow all players to claim rewards:
lp group default permission set ohhshiny.claim true
To give moderators full access except clearall:
lp group moderator permission set ohhshiny.base true
lp group moderator permission set ohhshiny.claim true
lp group moderator permission set ohhshiny.set true
lp group moderator permission set ohhshiny.remove true
lp group moderator permission set ohhshiny.list true
lp group moderator permission set ohhshiny.give true
lp group moderator permission set ohhshiny.reload true
lp group moderator permission set ohhshiny.reset true
To give admins complete access:
lp group admin permission set ohhshiny.* true
Language Configuration
All messages are fully configurable through a language file. The file is automatically created at:
config/ohhshiny/lang.json
Basic Usage
Edit the lang.json file to customize any message:
{
"prefix": "<aqua>[Ohh Shiny]</aqua>",
"loot.claimed": "<aqua>You found something shiny: {item}!",
"error.already_claimed": "<red>You've already claimed this!"
}
After editing, reload with:
/ohhshiny reloadlang
Text Formatting
Requires TextPlaceholderAPI (optional but recommended).
Colors:
<red>, <green>, <blue>, <yellow>, <aqua>, <gold>, etc.
- Hex colors:
<#FF0000>
Formatting:
<bold>, <italic>, <underline>, <strikethrough>
Advanced:
- Gradients:
<gradient:blue:aqua>text</gradient>
- Rainbow:
<rainbow>text</rainbow>
- Hover:
<hover:'tooltip text'>hover me</hover>
Placeholders:
- Built-in:
{x}, {y}, {z}, {item}, {player}, {count}
- TextPlaceholderAPI:
%player:name%, %server:tps%, etc.
Example:
{
"prefix": "<gradient:aqua:blue><bold>[Ohh Shiny]</bold></gradient>",
"loot.claimed": "<rainbow>✨ You found: {item}! ✨</rainbow>"
}
Data Storage
All reward data is stored in JSON format at:
config/ohhshiny/ohhshiny.json
The file is automatically created on first use and updated whenever:
- Rewards are created or removed
- Players claim rewards
- Data is manually reloaded
Data Structure
Each reward entry contains:
- Location: Dimension and block coordinates
- Reward Item: Serialized item data (type, count, NBT data)
- Claimed Players: List of player UUIDs who have claimed this reward
You can manually edit this file, but remember to run /ohhshiny reload afterward to apply changes.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Authors
Support
For bug reports, feature requests, or questions, please open an issue on the project repository.
Performance
- Efficient storage: JSON-based with automatic saving
- Thread-safe: Uses concurrent data structures where needed
- Optimized particle effects: Runs on server tick with distance checks
Tips and Best Practices
- Backup your data: Always backup
config/ohhshiny/ohhshiny.json before major operations
- Use custom items: The built-in chest and pokeball heads make rewards more visually appealing
- Strategic placement: Place rewards in interesting or hard-to-reach locations
- Regular reloads: If you manually edit the JSON file, always reload afterward
- Permission hierarchy: Give players only the permissions they need
- Testing: Use
/ohhshiny reset to test rewards without creating new ones
- Visual feedback: The particle effects help players know they've found something special
Troubleshooting
Players can't claim rewards
- Verify they have the
ohhshiny.claim permission
- Check the server logs for permission errors
- Ensure LuckPerms is properly configured
Rewards not saving
- Check file permissions on the
config/ohhshiny directory
- Look for errors in the server console
- Try manually running
/ohhshiny reload
Rewards disappear after restart
- Ensure the
ohhshiny.json file exists and is not corrupted
- Check that the mod loaded correctly during startup
- Verify no other mods are interfering with the config directory
Particles not showing
- Particles automatically load on server start (as of v1.1.0)
- Particles only appear for players who haven't claimed the reward
- Particles only render within 16 blocks of a player
- Try running
/ohhshiny reload if particles still don't appear
评论 0
登录后参与评分
还没有评论,来抢沙发吧