HatPlugin
瞬间将任何物品变成你的帽子。
作者:Pingz0
一款轻量级、经过优化的 Paper 1.21+ 插件,允许玩家通过一条命令将任意物品佩戴为头盔。专为性能、简洁性和可定制性而构建。
✨ 功能特性
-
? /hat 命令
将你手中的物品即时装备为头盔
-
? 智能物品交换
自动将你当前的头盔与手中的物品进行交换
-
⏱ 可配置冷却时间
防止滥用,支持自定义冷却系统
-
? 自定义音效
成功或失败时播放不同的声音
-
? 完全可定制的消息
支持颜色代码(&a、&c 等)
-
⚡ 动作栏反馈
提供整洁、现代的用户界面反馈,避免聊天栏刷屏
-
? 实时重载配置
使用 /hat reload 即时重载配置文件
-
? 权限系统
hat.use → 使用 /hat 命令
hat.reload → 重载配置
-
? 轻量且优化
无不必要的监听器,对性能影响极小
? 安装方法
- 下载最新版本
- 将
.jar 文件放入 /plugins/ 文件夹
- 启动服务器
- 完成 ✅
⚙️ 配置说明
配置文件位于:
/plugins/HatPlugin/config.yml
示例:
# 使用 /hat 的冷却时间(秒)
cooldown: 1
# 成功时的消息
message: "&a现在你正戴着物品作为帽子!"
# 失败时的消息(手中没有物品)
failmessage: "&c你需要手持一个物品!"
# 失败时的音效
failsound: "ENTITY.VILLAGER.NO"
# 成功时的音效
sound: "ITEM_ARMOR_EQUIP_GENERIC"
? 命令列表
| 命令 |
描述 |
权限 |
/hat |
将物品装备为头盔 |
hat.use |
/hat reload |
重载配置 |
hat.reload |
? 权限说明
| 权限 |
默认值 |
描述 |
hat.use |
true |
使用 /hat 命令 |
hat.reload |
op |
重载配置文件 |
? 使用方法
- 手中持有任意物品
- 执行
/hat
- 该物品即成为你的头盔
- 如果你已经佩戴了头盔 → 它将自动交换
⚡ 兼容性
- ✅ Paper 1.21+
- ❌ Spigot(不推荐)
- ❌ Bukkit(不支持)
? 技术备注
- 使用 Paper API 以获得最佳性能
- 安全的音效解析(防止因无效配置值导致崩溃)
- 针对每个玩家优化冷却处理
- 清晰的代码结构,便于扩展
? 计划中的功能
- 黑名单特定物品(例如潜影盒)
- 按世界设置
- 基于 GUI 的帽子选择器
- 粒子效果
? 技术支持
如果发现错误或希望添加新功能:
? 许可证
本项目采用 MIT 许可证授权。
HatPlugin
Turn anything into your hat – instantly.
Made By Pingz0
A lightweight, optimized Paper 1.21+ plugin that lets players wear any item as a helmet with a single command. Built for performance, simplicity, and customization.
✨ Features
-
? /hat Command
Instantly equip the item in your hand as your helmet
-
? Smart Item Swapping
Automatically swaps your current helmet with the item in your hand
-
⏱ Configurable Cooldown
Prevent spam with a customizable cooldown system
-
? Custom Sounds
Play different sounds for success and failure
-
? Fully Customizable Messages
Supports color codes (&a, &c, etc.)
-
⚡ Actionbar Feedback
Clean, modern UI feedback instead of chat spam
-
? Live Config Reload
Reload config instantly with /hat reload
-
? Permission System
hat.use → Use /hat
hat.reload → Reload config
-
? Lightweight & Optimized
No unnecessary listeners, minimal performance impact
? Installation
- Download the latest release
- Place the
.jar file into your /plugins/ folder
- Start your server
- Done ✅
⚙️ Configuration
Located at:
/plugins/HatPlugin/config.yml
Example:
# Cooldown between using /hat (seconds)
cooldown: 1
# Message on success
message: "&aNow wearing your item as a hat!"
# Message on failure (no item in hand)
failmessage: "&cYou need to hold an item!"
# Sound on failure
failsound: "ENTITY.VILLAGER.NO"
# Sound on success
sound: "ITEM_ARMOR_EQUIP_GENERIC"
? Commands
| Command |
Description |
Permission |
/hat |
Equip item as helmet |
hat.use |
/hat reload |
Reload config |
hat.reload |
? Permissions
| Permission |
Default |
Description |
hat.use |
true |
Use the /hat command |
hat.reload |
op |
Reload the config |
? How it works
- Hold any item in your hand
- Run
/hat
- Your item becomes your helmet
- If you already have a helmet → it swaps automatically
⚡ Compatibility
- ✅ Paper 1.21+
- ❌ Spigot (not recommended)
- ❌ Bukkit (not supported)
? Technical Notes
- Uses Paper API for best performance
- Safe sound parsing (prevents crashes from invalid config values)
- Optimized cooldown handling per player
- Clean code structure for easy expansion
? Planned Features
- Blacklist certain items (e.g. shulker boxes)
- Per-world settings
- GUI-based hat selector
- Particle effects
? Support
If you find bugs or want new features:
- Open an issue
- Or contact the developer
? License
This project is licensed under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧