RollCommand 插件
RollCommand 是一款 Minecraft 插件,允许服务器管理员创建和管理命令列表,以便随机执行其中的命令。通过此插件,您可以配置多个命令列表——每个列表都有独立的冷却时间和加权命令选择机制——从而为服务器增添趣味性和多样性。
功能特性
-
随机命令执行:
使用 /roll 命令从当前选定的列表中随机执行一条命令。
-
多命令列表支持:
定义多个具有独特冷却时间和命令权重的命令列表。
-
加权命令:
为命令分配权重,以影响其被选中的概率。
-
游戏内管理:
使用 /rlist 命令查看可用的命令列表并选择其中一个作为当前活动列表。
-
管理员测试:
执行测试命令(/rtest)以运行随机命令,且不影响冷却时间(仅限管理员)。
命令说明
-
/roll (别名: /r)
- 从当前活动的命令列表中随机执行一条命令。
- 权限:
rollCommand.use
-
/rlist <list>
- 当提供列表名称时,将其设置为当前活动的命令列表。
- 不带参数时,显示所有可用的命令列表以及当前正在使用的列表。
- 权限:
rollCommand.admin
-
/rtest
- 随机执行一条命令,且不强制执行冷却时间。
- 权限:
rollCommand.admin
配置说明
插件的配置定义在 src/main/resources/config.yml 中。以下是一个示例配置:
chosenList: exampleList
commandLists:
diamondList:
cooldown: 120
commands:
- command: "/give %p diamond 64"
weight: 1
- command: "/give %p diamond_block 32"
weight: 2
- command: "/effect give %p haste 300 2"
weight: 3
exampleList:
cooldown: 60
commands:
- command: "/give %p diamond 1"
weight: 1
- command: "/say Hello, %p!"
weight: 2
funList:
cooldown: 30
commands:
- command: "/effect give %p jump_boost 30 3"
weight: 3
- command: "/effect give %p speed 30 2"
weight: 2
- command: "/give %p cookie 1"
weight: 1
配置详情:
插件清单
插件详细信息存储在 plugin.yml 中。此文件定义:
- 插件的名称和描述。
- 主类,即
link.kmaba.rollCommand.App。
- 命令(
/roll、/rlist 和 /rtest)及其使用说明。
- 所需权限:
rollCommand.use(默认:true)
rollCommand.admin(默认:op)
快速入门
-
部署插件:
将编译好的 jar 包(rollCommand-0.0.1.jar)放入服务器的 plugins 文件夹中。
-
配置:
根据需要调整 config.yml 中的设置。
-
启动服务器:
启动或重新加载您的服务器。
-
使用命令:
- 执行
/roll / /r 以从当前激活的列表中随机执行一条命令。
- 使用
/rlist 查看可用的命令列表或切换当前激活的列表。
- 使用
/rtest 测试命令(需要管理员权限)。
RollCommand Plugin
RollCommand is a Minecraft plugin that allows server administrators to create and manage lists of commands to be executed at random. With this plugin, you can configure multiple command lists—each with its own cooldown and weighted command selection—to add fun and variety to your server.
Features
-
Random Command Execution:
Execute a random command from the currently selected list using the /roll command.
-
Multiple Command Lists:
Define several command lists with unique cooldown periods and command weights.
-
Weighted Commands:
Assign weights to commands to influence the likelihood of selection.
-
In-Game Management:
Use the /rlist command to display available command lists and select an active one.
-
Admin Testing:
Execute a test command (/rtest) to run a random command without affecting cooldowns (Admin only).
Commands
-
/roll (alias: /r)
- Executes a random command from the active command list.
- Permission:
rollCommand.use
-
/rlist <list>
- When provided with a list name, sets it as the active command list.
- Without arguments, displays available command lists and the currently active one.
- Permission:
rollCommand.admin
-
/rtest
- Executes a random command without enforcing the cooldown period.
- Permission:
rollCommand.admin
Configuration
The plugin configuration is defined in src/main/resources/config.yml. Below is an example configuration:
chosenList: exampleList
commandLists:
diamondList:
cooldown: 120
commands:
- command: "/give %p diamond 64"
weight: 1
- command: "/give %p diamond_block 32"
weight: 2
- command: "/effect give %p haste 300 2"
weight: 3
exampleList:
cooldown: 60
commands:
- command: "/give %p diamond 1"
weight: 1
- command: "/say Hello, %p!"
weight: 2
funList:
cooldown: 30
commands:
- command: "/effect give %p jump_boost 30 3"
weight: 3
- command: "/effect give %p speed 30 2"
weight: 2
- command: "/give %p cookie 1"
weight: 1
Configuration Details:
-
chosenList:
Specifies the active command list to be used by the /roll and /rtest commands.
-
commandLists:
Under this section, each command list (e.g., exampleList, diamondList, funList) can have its own cooldown (in seconds) and a list of commands.
Each command is defined along with a weight that influences its random selection probability.
%p in a command will be replaced by the player's name.
Plugin Manifest
The plugin details are stored in plugin.yml. This file defines:
- The plugin name and description.
- The main class, which is
link.kmaba.rollCommand.App.
- Commands (
/roll, /rlist, and /rtest) along with their usage instructions.
- Required permissions:
rollCommand.use (default: true)
rollCommand.admin (default: op)
Quick Start
-
Deploy the Plugin:
Place the compiled jar (rollCommand-0.0.1.jar) into your server's plugins folder.
-
Configure:
Adjust the settings in config.yml as needed.
-
Start the Server:
Launch or reload your server.
-
Use the Commands:
- Execute
/roll / /r to perform a random command from the active list.
- Use
/rlist to view available command lists or change the active list.
- Test commands with
/rtest (requires admin permission).
评论 0
登录后参与评分
还没有评论,来抢沙发吧