- 版权类型
- 原创
- 插件中文名称
- 牌子命令
- 插件英文名称
- LeonSignCommand
- 原帖地址
- #
- 支持的核心(服务端)
- Paper
- Purpur
- 语言支持
- 中文(简体)
- 前置组件
- PlaceHolderAPI
Vault
PlayerPoints
- 适配版本(Java)
- 1.21
LeonSignCommand
适用于 Paper / Purpur 1.21+ 的交互牌子插件。
## 功能
- 每个牌子对应 `plugins/LeonSignCommand/signs/<id>.yml` 一个独立文件。
- 支持自定义 4 行牌子文字。
- 支持 `&a`、`&l` 等传统颜色代码。
- 支持 hex 颜色:`&#RRGGBB` 或 `#RRGGBB`,例如 `&#FFAA00商店`。
- 牌子显示文字和交互执行命令互相独立,可分别在牌子文件中修改。
- 支持多个交互命令。
- `[console]` 由控制台执行。
- `[player]` 由玩家执行。
- 命令和消息支持 PlaceholderAPI。
- 支持 Vault 经济、PlayerPoints、经验点数 EXP、经验等级 LEVEL。
- 扣费前会先检查玩家余额/点券/经验/等级,不足时禁止交互并发送提示。
- 每个牌子可单独设置使用权限。
- 已注册牌子不可被普通破坏,只能管理员准星对准牌子后 `/lsc delete` 删除牌子和对应文件。
## 安装依赖
必需:
- Paper 或 Purpur 1.21+
- Java 21+
可选:
- Vault + 经济插件,例如 EssentialsX Economy、CMI Economy 等。只有 `cost.type: VAULT` 时需要。
- PlayerPoints。只有 `cost.type: PLAYERPOINTS` 时需要。
- PlaceholderAPI。只有需要解析 `%xxx%` 占位符时需要。
## 安装
1. 将 `LeonSignCommand-1.0.2.jar` 放入服务器 `plugins` 文件夹。
2. 重启服务器。
3. 进入游戏放置一个普通牌子。
4. 管理员准星对准该牌子,执行:
```
/lsc create shop1
```
5. 插件会生成:
```
plugins/LeonSignCommand/signs/shop1.yml
```
## 管理命令
所有管理命令需要权限:
```yaml
leonsigncommand.admin
```
命令缩写固定为 `/lsc`。
```text
/lsc help
/lsc create <id>
/lsc delete
/lsc reload
/lsc list
/lsc info
/lsc setline <1-4> <text>
/lsc command add <console|player> <command>
/lsc command clear
/lsc price <none|vault|playerpoints|exp|level> [amount]
/lsc permission <node|none>
/lsc cooldown <seconds>
```
## 示例:创建一个花费 Vault 金币的商店牌子
准星对准一个已放置的牌子:
```text
/lsc create vip_shop
/lsc setline 1 &#FFD700&lVIP商店
/lsc setline 2 &f花费: &a100金币
/lsc setline 3 &7右键购买
/lsc setline 4 &8仅限VIP
/lsc command clear
/lsc command add console lp user {player} parent add vip
/lsc command add console say {player} 购买了 VIP
/lsc price vault 100
/lsc permission shop.vip
```
玩家右键时:
1. 先检查 `shop.vip` 权限。
2. 再检查 Vault 余额是否至少 100。
3. 不足则禁止执行命令并发送 `config.yml` 中的余额不足消息。
4. 足够则扣除 100,然后执行配置的命令。
## 牌子文件示例
路径:
```text
plugins/LeonSignCommand/signs/vip_shop.yml
```
内容:
```yaml
id: vip_shop
location:
world: world
x: 100
y: 64
z: 200
sign:
lines:
- "&#FFD700&lVIP商店"
- "&f花费: &a100金币"
- "&7右键购买"
- "&8仅限VIP"
interaction:
permission: "shop.vip"
cooldown-seconds: 3
cost:
type: "VAULT"
amount: 100.0
commands:
- "[console] lp user {player} parent add vip"
- "[console] say {player} 购买了 VIP"
```
## cost.type 可用值
```text
NONE 不收费
VAULT Vault 经济
PLAYERPOINTS PlayerPoints 点券
EXP 经验点数
LEVEL 经验等级
```
示例:
```yaml
interaction:
cost:
type: "PLAYERPOINTS"
amount: 50
```
```yaml
interaction:
cost:
type: "EXP"
amount: 30
```
```yaml
interaction:
cost:
type: "LEVEL"
amount: 5
```
## PlaceholderAPI 和变量
命令和消息中可用:
```text
{player} 玩家名
{uuid} 玩家 UUID
{sign} 牌子 ID
{file} 牌子文件名
{world} 世界名
{x} {y} {z} 牌子坐标
```
如果服务器安装 PlaceholderAPI,也可以使用:
```text
%player_name%
%vault_eco_balance%
```
示例:
```yaml
commands:
- "[console] say %player_name% clicked {sign}"
```
注意:牌子方块上的 4 行文字是静态方块数据。命令和消息支持玩家专属 PlaceholderAPI;牌子显示文字不会针对不同玩家动态变化。
## 消息自定义
所有交互消息都在:
```text
plugins/LeonSignCommand/config.yml
```
`messages:` 下自定义。
修改后执行:
```text
/lsc reload
```
## v1.0.1 修复说明
- 修复 1.0.0 在 Paper 1.21.4 启动时报 `NoSuchMethodError: getConfig()` 的问题。
- Vault 和 PlaceholderAPI 改为运行时反射检测,未安装可选依赖时也不会阻止插件启动。
## v1.0.2 修复说明
- 修复 1.0.1 在 Paper 1.21.4 右键执行 `[console]` 命令时报 `NoSuchMethodError: Bukkit.getConsoleSender()` 的问题。
- 控制台命令分发改为运行时反射调用,避免不同 Paper/Bukkit API 返回类型签名导致错误。
适用于 Paper / Purpur 1.21+ 的交互牌子插件。
## 功能
- 每个牌子对应 `plugins/LeonSignCommand/signs/<id>.yml` 一个独立文件。
- 支持自定义 4 行牌子文字。
- 支持 `&a`、`&l` 等传统颜色代码。
- 支持 hex 颜色:`&#RRGGBB` 或 `#RRGGBB`,例如 `&#FFAA00商店`。
- 牌子显示文字和交互执行命令互相独立,可分别在牌子文件中修改。
- 支持多个交互命令。
- `[console]` 由控制台执行。
- `[player]` 由玩家执行。
- 命令和消息支持 PlaceholderAPI。
- 支持 Vault 经济、PlayerPoints、经验点数 EXP、经验等级 LEVEL。
- 扣费前会先检查玩家余额/点券/经验/等级,不足时禁止交互并发送提示。
- 每个牌子可单独设置使用权限。
- 已注册牌子不可被普通破坏,只能管理员准星对准牌子后 `/lsc delete` 删除牌子和对应文件。
## 安装依赖
必需:
- Paper 或 Purpur 1.21+
- Java 21+
可选:
- Vault + 经济插件,例如 EssentialsX Economy、CMI Economy 等。只有 `cost.type: VAULT` 时需要。
- PlayerPoints。只有 `cost.type: PLAYERPOINTS` 时需要。
- PlaceholderAPI。只有需要解析 `%xxx%` 占位符时需要。
## 安装
1. 将 `LeonSignCommand-1.0.2.jar` 放入服务器 `plugins` 文件夹。
2. 重启服务器。
3. 进入游戏放置一个普通牌子。
4. 管理员准星对准该牌子,执行:
```
/lsc create shop1
```
5. 插件会生成:
```
plugins/LeonSignCommand/signs/shop1.yml
```
## 管理命令
所有管理命令需要权限:
```yaml
leonsigncommand.admin
```
命令缩写固定为 `/lsc`。
```text
/lsc help
/lsc create <id>
/lsc delete
/lsc reload
/lsc list
/lsc info
/lsc setline <1-4> <text>
/lsc command add <console|player> <command>
/lsc command clear
/lsc price <none|vault|playerpoints|exp|level> [amount]
/lsc permission <node|none>
/lsc cooldown <seconds>
```
## 示例:创建一个花费 Vault 金币的商店牌子
准星对准一个已放置的牌子:
```text
/lsc create vip_shop
/lsc setline 1 &#FFD700&lVIP商店
/lsc setline 2 &f花费: &a100金币
/lsc setline 3 &7右键购买
/lsc setline 4 &8仅限VIP
/lsc command clear
/lsc command add console lp user {player} parent add vip
/lsc command add console say {player} 购买了 VIP
/lsc price vault 100
/lsc permission shop.vip
```
玩家右键时:
1. 先检查 `shop.vip` 权限。
2. 再检查 Vault 余额是否至少 100。
3. 不足则禁止执行命令并发送 `config.yml` 中的余额不足消息。
4. 足够则扣除 100,然后执行配置的命令。
## 牌子文件示例
路径:
```text
plugins/LeonSignCommand/signs/vip_shop.yml
```
内容:
```yaml
id: vip_shop
location:
world: world
x: 100
y: 64
z: 200
sign:
lines:
- "&#FFD700&lVIP商店"
- "&f花费: &a100金币"
- "&7右键购买"
- "&8仅限VIP"
interaction:
permission: "shop.vip"
cooldown-seconds: 3
cost:
type: "VAULT"
amount: 100.0
commands:
- "[console] lp user {player} parent add vip"
- "[console] say {player} 购买了 VIP"
```
## cost.type 可用值
```text
NONE 不收费
VAULT Vault 经济
PLAYERPOINTS PlayerPoints 点券
EXP 经验点数
LEVEL 经验等级
```
示例:
```yaml
interaction:
cost:
type: "PLAYERPOINTS"
amount: 50
```
```yaml
interaction:
cost:
type: "EXP"
amount: 30
```
```yaml
interaction:
cost:
type: "LEVEL"
amount: 5
```
## PlaceholderAPI 和变量
命令和消息中可用:
```text
{player} 玩家名
{uuid} 玩家 UUID
{sign} 牌子 ID
{file} 牌子文件名
{world} 世界名
{x} {y} {z} 牌子坐标
```
如果服务器安装 PlaceholderAPI,也可以使用:
```text
%player_name%
%vault_eco_balance%
```
示例:
```yaml
commands:
- "[console] say %player_name% clicked {sign}"
```
注意:牌子方块上的 4 行文字是静态方块数据。命令和消息支持玩家专属 PlaceholderAPI;牌子显示文字不会针对不同玩家动态变化。
## 消息自定义
所有交互消息都在:
```text
plugins/LeonSignCommand/config.yml
```
`messages:` 下自定义。
修改后执行:
```text
/lsc reload
```
## v1.0.1 修复说明
- 修复 1.0.0 在 Paper 1.21.4 启动时报 `NoSuchMethodError: getConfig()` 的问题。
- Vault 和 PlaceholderAPI 改为运行时反射检测,未安装可选依赖时也不会阻止插件启动。
## v1.0.2 修复说明
- 修复 1.0.1 在 Paper 1.21.4 右键执行 `[console]` 命令时报 `NoSuchMethodError: Bukkit.getConsoleSender()` 的问题。
- 控制台命令分发改为运行时反射调用,避免不同 Paper/Bukkit API 返回类型签名导致错误。