? DuckySkript
DuckySkript 是一款功能强大且轻量级的 Spigot/Paper Minecraft 插件,允许管理员通过简单的 YAML 文件创建自定义脚本,并在玩家与 Citizens NPC 互动或手动执行时运行动态命令。
使用 DuckySkript,您可以根据玩家权限配置条件命令执行,以控制台、玩家或临时 OP(管理员)身份执行命令,并轻松个性化玩家交互体验。
重要提示:需要安装 Citizens 插件!
✨ 特性
- Citizens 集成: 当玩家右键点击 Citizens NPC 时执行脚本序列。
- YAML 脚本编写: 使用标准 YAML 格式进行简单、可读性强且高度可定制的脚本创建。
- 条件执行: 根据权限节点从上到下评估脚本步骤。支持默认回退块(fallback block)。
- 灵活的执行上下文:
- 以控制台发送者身份运行命令。
- 以玩家身份运行命令。
- 以操作员(OP)身份临时运行命令,安全地绕过权限限制。
- 占位符支持: 使用
%player% 动态注入正在互动的玩家名称。
- 命令回退与别名: 完全向后兼容现有设置(支持
/duckyskript、/ds、/ducky 和 /pn)。
- 权限回退: 无缝支持旧版
parlanpccmd.xxx 和新版 duckyskript.xxx 权限结构。
- 多语言支持: 开箱即用,提供英语和希伯来语本地化文件。
? 安装与设置
- 确保您的服务器上已安装 Citizens(可选,但强烈建议用于 NPC 功能)。
- 下载
DuckySkript.jar 并将其放入服务器的 plugins 文件夹中。
- 重启或重载服务器以生成配置文件。
- 在
plugins/DuckySkript/config.yml 中自定义设置,并在 plugins/DuckySkript/scripts/ 目录中添加脚本。
⚙️ 命令与权限
命令
/duckyskript help - 显示帮助菜单。
/duckyskript reload - 重新加载所有配置文件和脚本。
/duckyskript run <script> [player] - 为玩家手动触发脚本序列。
注意:您可以使用 /ds、/ducky 或 /pn 别名来代替 /duckyskript。
权限
duckyskript.use - 使用帮助命令所需。(默认:true)
duckyskript.admin - 重载插件所需。(默认:op)
duckyskript.run - 手动运行脚本所需。(默认:op)
注意:以 parlanpccmd. 开头的旧版权限会自动识别为回退权限。
? 脚本编写指南
所有脚本均位于 plugins/DuckySkript/scripts/ 中。每个 YAML 脚本文件可以包含不同的命令序列,这些序列将根据玩家权限进行匹配。插件会从上到下解析这些权限,并执行第一个匹配的块。
执行上下文
- 控制台命令(默认): 从控制台运行命令。
- "give %player% diamond 5"
- 玩家命令: 以互动的玩家身份运行命令。
- "say Hello!":
config:
asPlayer: true
- OP 命令: 以玩家身份运行命令,临时授予其 OP 状态以执行该命令(适用于需要管理员权限的命令)。
- "gamemode creative":
config:
asPlayer: true
asOP: true
示例脚本 (scripts/example.yml)
# DuckySkript 示例脚本
scripts:
# 检查玩家是否具有 VIP 权限
duckyskript.vip:
- "say I am a VIP!":
config:
asPlayer: true
asOP: false
- "give %player% diamond 5"
- "broadcast %player% just talked to the VIP NPC!"
# 检查玩家是否具有成员权限
duckyskript.member:
- "say Hello, I am a member!":
config:
asPlayer: true
- "give %player% iron_ingot 10"
# 如果没有权限节点匹配,则使用默认回退
default:
- "say I don't have any special permissions yet.":
config:
asPlayer: true
? 将脚本分配给 NPC
要将脚本绑定到 Citizens NPC,请选择该 NPC 并使用 Citizens 命令应用元数据:
/npc select
/npc metadata --set duckyskript-script <script_name>
(将 <script_name> 替换为您的脚本文件名,不包括 .yml 扩展名)
为了向后兼容,插件还会检查 parlanpc-script 元数据键。
? 本地化
DuckySkript 开箱即用支持希伯来语和英语。您可以在 config.yml 中配置您的语言:
# 用于消息的语言
# 支持:en, he
language: en
在 messages_en.yml 或 messages_he.yml 中自定义所有消息。
? DuckySkript
DuckySkript is a powerful, lightweight Spigot/Paper Minecraft plugin that allows administrators to create custom scripts via simple YAML files and execute dynamic commands when players interact with Citizens NPCs or run them manually.
With DuckySkript, you can configure conditional command execution based on player permissions, execute commands as the console, player, or temporary OP, and personalize player interactions effortlessly.
Important: Citizens plugin required!
✨ Features
- Citizens Integration: Execute script sequences when players right-click a Citizens NPC.
- YAML Scripting: Simple, readable, and highly customizable script creation using standard YAML format.
- Conditional Execution: Evaluate script steps in top-to-bottom order based on permission nodes. Supports default fallback blocks.
- Flexible Execution Contexts:
- Run commands as the Console sender.
- Run commands as the Player.
- Run commands as Operator (OP) temporarily, bypassing permission restrictions safely.
- Placeholder Support: Dynamically inject the interacting player's name using
%player%.
- Command Fallback & Aliases: Fully backwards compatible with existing setups (supports
/duckyskript, /ds, /ducky, and /pn).
- Permission Fallback: Seamless support for both legacy
parlanpccmd.xxx and new duckyskript.xxx permission structures.
- Multi-language Support: English and Hebrew localization files out of the box.
? Installation & Setup
- Make sure you have Citizens installed on your server (optional but highly recommended for NPC functionality).
- Download
DuckySkript.jar and place it in your server's plugins folder.
- Restart or reload the server to generate configuration files.
- Customize settings in
plugins/DuckySkript/config.yml and add scripts in the plugins/DuckySkript/scripts/ directory.
⚙️ Commands & Permissions
Commands
/duckyskript help - Displays the help menu.
/duckyskript reload - Reloads all configuration files and scripts.
/duckyskript run <script> [player] - Manually triggers a script sequence for a player.
Note: You can use the /ds, /ducky, or /pn aliases instead of /duckyskript.
Permissions
duckyskript.use - Required to use the help command. (Default: true)
duckyskript.admin - Required to reload the plugin. (Default: op)
duckyskript.run - Required to manually run a script. (Default: op)
Note: Legacy permissions starting with parlanpccmd. are automatically recognized as fallbacks.
? Scripting Guide
All scripts are located in plugins/DuckySkript/scripts/. Each YAML script file can contain different command sequences matched against player permissions. The plugin parses these permissions from top to bottom, executing the first matching block.
Execution Contexts
- Console Command (Default): Runs the command from the console console.
- "give %player% diamond 5"
- Player Command: Runs the command as the interacting player.
- "say Hello!":
config:
asPlayer: true
- OP Command: Runs the command as the player, temporarily granting them OP status to execute it (ideal for commands requiring admin permissions).
- "gamemode creative":
config:
asPlayer: true
asOP: true
Example Script (scripts/example.yml)
# Example Script for DuckySkript
scripts:
# Check if player has VIP permission
duckyskript.vip:
- "say I am a VIP!":
config:
asPlayer: true
asOP: false
- "give %player% diamond 5"
- "broadcast %player% just talked to the VIP NPC!"
# Check if player has member permission
duckyskript.member:
- "say Hello, I am a member!":
config:
asPlayer: true
- "give %player% iron_ingot 10"
# Default fallback if no permission nodes match
default:
- "say I don't have any special permissions yet.":
config:
asPlayer: true
? Assigning Scripts to NPCs
To bind a script to a Citizens NPC, select the NPC and apply the metadata using Citizens commands:
/npc select
/npc metadata --set duckyskript-script <script_name>
(Replace <script_name> with the name of your script file, excluding the .yml extension)
For backward compatibility, the plugin also checks the parlanpc-script metadata key.
? Localization
DuckySkript supports Hebrew and English out of the box. You can configure your language in config.yml:
# Language to use for messages
# Supported: en, he
language: en
Customize all messages in messages_en.yml or messages_he.yml.
评论 0
登录后参与评分
还没有评论,来抢沙发吧