# ShowItemPlus - 物品展示增强插件 | Enhanced Item Display Plugin
## 中文介绍
### 插件概述
ShowItemPlus是一款双模适配器插件,同时兼容BungeeCord和Spigot平台,旨在提供便捷的物品展示功能。玩家可以通过特定的指令格式在全服聊天中展示手中的物品,使得交易、展示和分享变得更加直观和便利。
### 主要特性
- **双模架构** - 同时适配BungeeCord和Spigot,提供跨服通信能力
- **物品信息展示** - 在聊天中显示物品名称和自定义文本
- **悬停详情** - 鼠标悬停在物品名称上可查看完整物品属性和描述
- **自定义触发指令** - 通过`@sip`或命令`/showitem`(别名`/sip`)触发物品展示功能
- **配置缓存** - 优化配置读取,提高性能
- **消息转发** - 通过BungeeCord有效转发物品展示消息到所有子服
- **GZIP压缩支持** - 自动检测并压缩过大的数据,提高网络传输效率
- **兼容性强** - 使用适配器模式避免API直接引用,增强兼容性
### 系统要求
- Spigot服务端:1.21.4
- BungeeCord服务端:最新稳定版
- Java版本:Java 21
### 安装方法
1. 下载插件JAR文件
2. 将JAR文件放入Spigot和BungeeCord服务器的plugins文件夹中
3. 重启服务器或使用插件管理器加载插件
4. 插件将自动生成默认配置文件
### 使用方法
#### 基本用法
**聊天触发方式**:
```
@Sip 这是我的钻石剑,很厉害吧?
```
**命令触发方式**:
```
/sip 这是我的钻石剑,很厉害吧?
```
或
```
/showitem 这是我的钻石剑,很厉害吧?
```
以上方式会在聊天中显示类似这样的消息:
```
[玩家名] 展示了 [钻石剑] 这是我的钻石剑,很厉害吧?
```
其中[钻石剑]是可以悬停查看详细属性的交互文本。
#### BungeeCord环境中使用
在BungeeCord环境中使用时,需要注意以下几点:
1. 确保BungeeCord服务器和所有子服务器都安装了该插件
2. 确保BungeeCord的`config.yml`中已启用插件消息通道
3. 在BungeeCord的权限设置中添加`showitemplus.use`权限,示例:
```yaml
permissions:
default:
- bungeecord.command.server
- bungeecord.command.list
- showitemplus.use # 添加物品展示权限
```
4. 如果物品无法正常展示,请检查网络连接和插件日志
### 权限节点
- `showitemplus.use` - 使用物品展示功能的权限
- `showitemplus.admin` - 管理员权限,可以使用所有命令
### 配置文件
配置文件(`config.yml`)中的主要选项:
Code (YAML):
# ShowItemPlus 配置文件
# 触发关键词
trigger
: '@sip'
# 消息设置
message
:
# 是否启用彩色消息
colored
: true
# 物品名称显示格式 (支持&颜色代码)
item-format
: '&b
[
%item_name%]&r'
# 消息格式
format
: '
[
%player_name%]: %item_display% %message%'
# 权限设置
permissions
:
# 是否检查权限
check
: true
# 使用物品展示功能所需权限
use
: 'showitemplus.use'
# 管理员权限
admin
: 'showitemplus.admin'
# 调试模式
debug
: false
### 常见问题
**Q: 为什么我的物品展示不起作用?**
A: 请确保:
- BungeeCord和所有子服都已安装本插件
- 你有BungeeCord`showitemplus.use`权限
- 手中确实有物品
- 检查插件日志是否有错误信息
**Q: 插件支持哪些Minecraft版本?**
A: 插件目前专为Minecraft 1.21.4版本开发,其他版本可能会有兼容性问题。
**Q: 可以展示背包/箱子中的物品吗?**
A: 目前版本只支持展示手中的物品,未来版本可能会添加展示背包物品的功能。
**Q: 是否支持NBT标签的物品?**
A: 是的,插件完全支持带有复杂NBT标签的物品,并且针对大型NBT数据启用了自动压缩功能。
---
## English
### Plugin Overview
ShowItemPlus is a dual-mode adapter plugin that is compatible with both BungeeCord and Spigot platforms, designed to provide convenient item display functionality. Players can showcase items in their hands through specific command formats in server-wide chat, making trading, displaying, and sharing more intuitive and convenient.
### Key Features
- **Dual-Mode Architecture** - Compatible with both BungeeCord and Spigot, providing cross-server communication capabilities
- **Item Information Display** - Display item names and custom text in chat
- **Hover Details** - Hover mouse over item names to view complete item attributes and descriptions
- **Custom Trigger Commands** - Trigger item display functionality via `@sip` or commands `/showitem` (alias `/sip`)
- **Configuration Caching** - Optimize configuration reading for better performance
- **Message Forwarding** - Effectively forward item display messages to all sub-servers through BungeeCord
- **GZIP Compression Support** - Automatically detect and compress large data to improve network transmission efficiency
- **Strong Compatibility** - Uses adapter pattern to avoid direct API references, enhancing compatibility
### System Requirements
- Spigot Server: 1.21.4
- BungeeCord Server: Latest stable version
- Java Version: Java 21
### Installation
1. Download the plugin JAR file
2. Place the JAR file in the plugins folder of both Spigot and BungeeCord servers
3. Restart the server or load the plugin using a plugin manager
4. The plugin will automatically generate default configuration files
### Usage
#### Basic Usage
**Chat Trigger Method**:
```
@Sip This is my diamond sword, isn't it powerful?
```
**Command Trigger Method**:
```
/sip This is my diamond sword, isn't it powerful?
```
or
```
/showitem This is my diamond sword, isn't it powerful?
```
These methods will display a message in chat similar to:
```
[PlayerName] shows [Diamond Sword] This is my diamond sword, isn't it powerful?
```
Where [Diamond Sword] is interactive text that can be hovered over to view detailed attributes.
#### Using in BungeeCord Environment
When using in a BungeeCord environment, note the following:
1. Ensure the plugin is installed on both the BungeeCord server and all sub-servers
2. Make sure plugin messaging channels are enabled in BungeeCord's `config.yml`
3. Add the `showitemplus.use` permission to BungeeCord's permission settings, example:
```yaml
permissions:
default:
- bungeecord.command.server
- bungeecord.command.list
- showitemplus.use # Add item display permission
```
4. If items are not displaying properly, check network connections and plugin logs
### Permissions
- `showitemplus.use` - Permission to use the item display functionality
- `showitemplus.admin` - Administrator permission, can use all commands
### Configuration
Main options in the configuration file (`config.yml`):
Code (YAML):
# ShowItemPlus 配置文件
# 触发关键词
trigger
: '@sip'
# 消息设置
message
:
# 是否启用彩色消息
colored
: true
# 物品名称显示格式 (支持&颜色代码)
item-format
: '&b
[
%item_name%]&r'
# 消息格式
format
: '
[
%player_name%]: %item_display% %message%'
# 权限设置
permissions
:
# 是否检查权限
check
: true
# 使用物品展示功能所需权限
use
: 'showitemplus.use'
# 管理员权限
admin
: 'showitemplus.admin'
# 调试模式
debug
: false
### FAQ
**Q: Why doesn't my item display work?**
A: Please ensure:
- The plugin is installed on both BungeeCord and all sub-servers
- You have the `showitemplus.use` permission
- You actually have an item in your hand
- Check the plugin logs for any error messages
**Q: Which Minecraft versions does the plugin support?**
A: The plugin is currently developed for Minecraft version 1.21.4, other versions may have compatibility issues.
**Q: Can I display items from my inventory/chest?**
A: The current version only supports displaying items in hand, future versions may add functionality to display inventory items.
**Q: Does it support items with NBT tags?**
A: Yes, the plugin fully supports items with complex NBT tags, and has automatic compression for large NBT data.