cmdBook
简介:
cmdBook 是一个允许你执行并存储多条命令的插件。 你只需将命令(或聊天文本)放入书中,然后使用一条命令将其转换为 cmdbook。 当你用那本书左键点击时,你的命令就会被执行。你可以指定变量,以便用其他内容替换它们(例如:你的玩家名称、你正在查看的玩家等),并且还可以在其中添加 JavaScript。
版本信息
最新版本:1.4.5
发布日期:2013年12月15日

即将推出的功能
- 基本逻辑(If 语句、for 循环、自定义变量)
- 将此页面拆分为其他页面(权限、配置、示例等)(计划于 1.4.0 版)
- 与 Skript 和 CmdHelper 兼容,以便与书一起使用
- YouTube 教程(计划于 1.4.x 版)
- 游戏内配置编辑器(计划于 1.5.0 版)
兼容性
cmdBook 与大多数与书相关的插件兼容。
贡献
你喜欢 cmdBook 并希望帮助我进一步扩展它吗? 任何 捐赠 都将受到欢迎(即使只是够我买一杯咖啡来编程用的金额)。 如果你对代码有意见,也可以查看 源代码。 注意:未经我的允许,你不得复制任何代码。
命令
# 注意: /cb 或 /cbook 可以 互换 使用# 使用手中的书写本创建 cmdBook /cb create
# 在 cmdBook 中编辑/添加命令(其他书籍将被锁定) /cb edit
# 列出 cmdBook 内的命令 /cb info
# 显示插件信息 /cb about
# 使普通书籍私有化 /cb private
# 使普通书籍公开化 /cb public
# 重新加载配置文件 /cb reload
# 转换过时的变量 /cb convert
# 显示游戏内变量和信息 /cb variables
权限
cmdBook 使用权限系统来定义谁可以创建或使用 cmdbook。
创建 cmdBook
好的,要创建一个 cmdBook,你需要具备以下条件:
- 你必须获得制作它的权限
- 你必须获得使用它的权限(如果你只打算制作而不使用,则非必需)
- 你需要一本可写的书
- 在书的开头写上:[cmdbook]
- 换一行,然后输入你的第一个命令,例如 /broadcast Hello World!
- 使用字符 | 分隔你的命令,或者通过开始新的一页来分隔命令
- 创建第二个命令、第三个命令……
- 签署你的书
- 手持该书时输入命令 /cb create
- 现在左键点击该书以执行命令
变量
你可以定义多个变量进行替换
# 以控制台身份运行每条命令: @runconsole # 提示:如果你想让玩家在没有 OP 权限的情况下使用命令,你可能想使用 $chat[..]。# 隐藏所有 cmdBook 消息 # 这将隐藏诸如“命令已执行”或“等待中..”等内容 @hidemessages
# 这将被替换为使用该书的玩家名称 $player
# 这将被替换为你点击的玩家 $targetplayer
# 这将给你一个代表你生命值的整数 $health
# 这将给你一个代表你经验值的浮点数 $xp
# 这将给你一个代表目标玩家经验值的浮点数 $targetxp
# 这将给你一个代表你等级的整数 $lvl
# 这将给你一个代表目标玩家等级的浮点数 $targetlvl
# 这可以让你看到你的饥饿值(整数,0-10) $hunger
# 这可以让你看到目标玩家的饥饿值(整数,0-10) $targethunger
# 这将给你你的击杀者名称 $killer
# 这将给你目标玩家的击杀者名称 $targetkiller
# 这将给你 X 坐标 $xpos
# 这将给你 Y 坐标 $ypos
# 这将给你你所看向方块的 X 坐标 $losx
# 这将给出你所查看的方块的 y 坐标 $losy
# 这将给出你所查看的方块的 z 坐标 $losz
# 输入 - 一个非常方便的变量: # 输入变量会在所有命令执行前提示玩家 # 玩家在收到提示后在聊天栏中输入的数据(不使用任何命令,纯文本) # 将替换输入变量
$input -> 当 以 此 格式 使用 时 , 它 只会 要求 输入
$input[在此输入问题] -> put [文本] to customize your question
# 当使用 @input 而不是 $input 时,它会在书的开头输入用户 # $input 只会在命令执行前输入
# 延迟 - 变量为 $wait[int],将 int 替换为一个数字 # 这将导致命令执行暂停(以毫秒为单位) $wait[int]
# 执行 JavaScript,创建一个名为 'output' 的变量,该变量将替换 script[**] $script[javascript here] $script[var dNow = new Date();var output = 'Today is ' + dNow.getDate();]
# 进行简单计算 $calc[1+2] $calc[$losy+1]
# 向玩家发送私聊消息 $msg[messagehere]
# 广播一条消息 $broadcast[HEllo There!]
# 发送玩家聊天 $chat[..] # 仅在使用 @runconsole 时需要
请确保为所有 40 个变量使用 /cb 变量
示例
例1:
[cmdbook] /give $player cookie 1| I got a cookie :D|
例2:
[cmdbook] $targetplayer You have been caught griefing!| /ban $targetplayer Griefing Visual proof| /resident delete $targetplayer|
例3:
[cmdbook] /lb lookup player $targetplayer block 56 area 100 time 30 minutes|
例4:
PAGE1: [cmdbook] This is my first page| HELLOOWWPAGE2: This is my second command| /give $player cookie 10| :D
PAGE3: The End
例5:
[cmdbook] /ban $targetplayer $input[Why ban him?]| /lb rollback player $targetplayer time $input[How many days you want to rollback him?] days| $wait[2000]| /yes| $wait[10000]| /no
例6:
# permissions needed: - cmdbook.variable.runconsole - cmdbook.use[cmdbook] @runconsole /give $player cookie 1
示例7:
Will act like WorldEdit compass the calc adds 1 block to the y axis, so you dont teleport IN the block[cmdbook] /teleport $losx calc($losy+1) $losz
更新
本插件使用外部版本检查系统,这意味着插件会连接至 curseforge.com,并可能发生以下情况:
与已批准文件进行版本比对 下载插件文件 启动已下载的插件文件 您可以通过配置此插件来禁用检查和/或自动下载。
指标统计
本插件使用了 Hidendra 的插件指标系统,这意味着以下信息会被收集并发送至 mcstats.org:
唯一标识符 服务器的 Java 版本 服务器处于离线模式还是在线模式 插件的版本 服务器的版本 操作系统版本/名称及架构 CPU 核心数 在线玩家数量 Metrics 版本 如果您愿意,可以通过 /plugins/PluginMetrics/config.yml 禁用统计数据收集。
更改日志
版本 1.4.5
状态:可选
- 将 /cb 移动为 /cbook 的别名命令。现在您可以使用 /cb 或 /cbook,但 /cb 可能会被其他插件覆盖
- 修复了一些小错误
版本 1.4.3
状态:强烈推荐
- 添加了 @name[namehere](可放置在书籍任意位置)用于命名书籍
- 添加了基于名称 "cmdbook.book.namehere" 的权限,以便为每本书设置独立权限
- 修复了关于“您没有权限!”消息的多个错误
- 更新至 1.6.4

cmdBook
About:
cmdBook is a plugin that allows you to execute and store multiple commands. You just have to put the commands (or chat text) in a book, and use a command to make it a cmdbook. Whenever you left click with that book, your commands will be executed. You can specify variables so that you can replace them with (F.ex : your player name , the player you are looking at,..) and you can add javascript to it
Version Information
Latest Version: 1.4.5
Release date: 15/12/2013

Upcomming Features
- Basic Logic (If statements , for loops , custom variables)
- Devide this page into other pages (permissions, configuration , examples ,..) (planned 1.4.0)
- Compatibility with Skript and CmdHelper to use WITH a book
- A youtube tutorial (planned 1.4.x)
- Config editor ingame (planned 1.5.0)
Compatibility
cmdBook works with most book related plugins.
Contribute
Do you like cmdBook ant you want to help me expand it even further? Any donation will be welcome (Even if it is just enough so I can buy a cup of coffee while programming) The Source code is also available if you have remarks about the code. NOTE: You may not copy any of the code without asking me
Commands
# NOTE: /cb OR /cbook can be used# Create a cmdBook with the written book in your hand /cb create
# Edit/Add commands in a cmdBook (Other books are blocked) /cb edit
# List the commands inside a cmdBook /cb info
# Show plugin information /cb about
# Make a normal book private /cb private
# Make a normal book public /cb public
# Reload the configuration /cb reload
# Convert deprecated variables /cb convert
# Show ingame variables and info /cb variables
Permissions
cmdBook uses permissions to define who may create/use a cmdbook.
Create a cmdBook
Ok, to create a cmdBook you need a few things:
- You have to get the rights to make one
- You have to get the rights to use on (not necessarily if you only intend to make it)
- You need a Writable book
- Start you book with: [cmdbook]
- Create a new line and you can type your first command F.ex /broadcast Hello World!
- Split your commands with the character: | OR split commands by starting a new page
- Create a second command , third ,....
- Sign your book
- Type the command /cb create while holding the book in your hand
- Now left click the book to perform the commands
Variables
You can define several variables to replace
# Run every command as console: @runconsole # TIP: You might want to use $chat[..] if you want to let the player use a command without op perm.# Hide all cmdBook messages # This will hide thinigs like " Command performed" or " waiting.." @hidemessages
# This will be replaced with the name of the player that uses the book $player
# This will be replaced with the player you are clicking on $targetplayer
# This will give you an integer with your health $health
# This will give you a decimal with your xp $xp
# This will give you a decimal with your target's xp $targetxp
# This will give you an integer with your level $lvl
# This will give you an decimal with your target's level $targetlvl
# This allows you to see your hunger as integer (0-10) $hunger
# This allows you to see your target's hunger as integer (0-10) $targethunger
# This will give you your killers name $killer
# This will give you the name of your target's killer $targetkiller
# This will give your X position $xpos
# This will give your Y position $ypos
# This will give the xpos of the block you look at $losx
# This will give the ypos of the block you look at $losy
# This will give the zpos of the block you look at $losz
# Input - A very handy variable: # The input variable will prompt the player before all commands are executed # The data the player enters in chat after getting prompted (without any use of commands, just plain text) # will replace the input variable $input -> When using it in this format , it will just ask for an input $input[Question here] -> put [text] to customize your question
# When using @input instead of $input, it will input the user at the beginning of the book # the $input will only input right before the command will be executed
# Delay - variable is $wait[int] replace int with a number # This will cause the command execution to Pause (in ms) $wait[int]
# Execute javascript, create a variable 'output' this variable will replace the script[**] $script[javascript here] $script[var dNow = new Date();var output = 'Today is ' + dNow.getDate();]
# Make a simple calculation $calc[1+2] $calc[$losy+1]
# Send a private message to the player $msg[messagehere]
# Broadcast a message $broadcast[HEllo There!]
# Send player chat $chat[..] # Only required when using @runconsole
# MAKE SURE TO USE /cb variables for all 40 variables
Examples
Ex1:
[cmdbook] /give $player cookie 1| I got a cookie :D|
Ex2:
[cmdbook] $targetplayer You have been caught griefing!| /ban $targetplayer Griefing Visual proof| /resident delete $targetplayer|
Ex3:
[cmdbook] /lb lookup player $targetplayer block 56 area 100 time 30 minutes|
Ex4:
PAGE1: [cmdbook] This is my first page| HELLOOWWPAGE2: This is my second command| /give $player cookie 10| :D
PAGE3: The End
Ex5:
[cmdbook] /ban $targetplayer $input[Why ban him?]| /lb rollback player $targetplayer time $input[How many days you want to rollback him?] days| $wait[2000]| /yes| $wait[10000]| /no
Ex6:
# permissions needed: - cmdbook.variable.runconsole - cmdbook.use[cmdbook] @runconsole /give $player cookie 1
Ex7:
Will act like WorldEdit compass the calc adds 1 block to the y axis, so you dont teleport IN the block[cmdbook] /teleport $losx calc($losy+1) $losz
Updating
This plugin utilizes an external version checking system, which means that the plugin makes a connection to curseforge.com and the following may occur:
The plugins version checked against approved files Downloading of the plugin files Launching of the plugin files downloaded You can disable the check and/or automated download via the configuration of this plugin.
Metrics
This plugin utilizes Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:
A unique identifier The server's version of Java Whether the server is in offline or online mode The plugin's version The server's version The OS version/name and architecture The core count for the CPU The number of players online The Metrics version You can disable the stat collection via /plugins/PluginMetrics/config.yml if you wish.
Changes
Version 1.4.5
Status: Optional
- Moved /cb to an alias command of /cbook. You can now use /cb OR /cbook but /cb will be overridden by other plugins
- Fixed some small bugs
Version 1.4.3
Status: Higly Recommended
- Added @name[namehere] (put anywhere in your book) to name books
- Added permissions based on name "cmdbook.book.namehere" for individual permissions per book
- Fixed several bugs with "You do not have permissions!" messages
- Updated to 1.6.4
Click here to see all version changes

下载 cmdBook
下载 cmdBook
下载 cmdBook
下载 cmdBook
下载 cmdBook
下载 cmdBook
下载 cmdBook
下载 cmdBook
下载 cmdBook
下载 cmdBook
更新日志
版本 1.4.6
状态:推荐
- 更新至 1.7.2
- 新增 /cbook 命令(若与 /cb 冲突)
版本 1.4.3
状态:强烈推荐
- 新增 @name[namehere](可放置在书本任意位置)以命名书籍
- 新增基于名称 "cmdbook.book.namehere" 的权限,支持针对单个书籍设置独立权限
- 修复了多条“你没有权限!”消息相关的多个错误
- 更新至 1.6.4
版本 1.4.2
状态:推荐
- 修复了更新器
- 新增示例书籍 /cb examples
- 为工作台等物品添加了权限节点
- 修复了多个错误
版本 1.4.1
状态:错误修复
- 修复了压力板错误
- 修复了 /cb info 命令中的冷却时间错误
- 修复了 /cd variables 5 命令的错误
- /cb info 现在显示使用次数/冷却时间/价格
- 新增检查更新功能(在配置文件中切换开关)
版本 1.4.0
状态:已更新并增加更多功能
- 适配 CB 1.5.2
- 更新至最新版本的 Towny 和 Vault
- 新增 @cooldown[minutes] 和 @lastused[yyyy/MM/dd HH:mm:ss]。两者均需设置才能启用冷却时间功能
- 新增 $workbench 和 $enchtable 用于打开附魔台或合成台的图形界面
- 修复了多个错误
版本 1.3.9
状态:增加更多功能
- 新增对木质和石质按钮的支持
- 新增箱子范围的相关配置选项
- 更新了部分权限,但暂时无法生效
版本 1.3.6
状态:小幅更新 + 错误修复
- 编译适用于 1.4.7 R1.0
- 完全移除了更新器……直到我有时间修复它
- 新增 @pay[..] 以覆盖使用 cmdbook 时的默认费用
- 新增 @uses[..] 以定义书籍的使用次数(每次使用后减 1,直至为 0)
- 新增 @destroywhenused 当 @uses = 0 时销毁该书(可能效果不佳)
- 修复了经济系统错误
- 新增了基础权限结构:cmdbook.use.xxxx 和 cmdbook.variable.xxx 将会被更改 cmdbook.use.xxxx 允许你在书中使用变量 cmdbook.variable.xxxx 允许你在书中使用和添加变量 !!!注意:此功能尚未实现!!!(我知道,确实还没做完)
版本 1.3.5
状态:最高优先级!!
- 移除了更新器(默认为 true),因为它存在严重错误!!
- 新增了压力板命令
- 新增了基础权限结构:cmdbook.use.xxxx 和 cmdbook.variable.xxx 将会被更改 cmdbook.use.xxxx 允许你在书中使用变量 cmdbook.variable.xxxx 允许你在书中使用和添加变量 !!!注意:此功能尚未实现!!!
版本 1.3.4
状态:小幅更新,但强烈推荐
- 修复了 1.3.3 版本的更新器
- 新增通过 Vault 支持经济系统,你可以修改创建/编辑/使用 cmdbook 的价格
- cmdBook 更新器现在会检查与你当前 craftbook 版本匹配的最新版本
- 在配置中添加了 opPermissions,但可能无法完全正常工作
- 新增了基础权限结构:cmdbook.use.xxxx 和 cmdbook.variable.xxx 将会被更改 cmdbook.use.xxxx 允许你在书中使用变量 cmdbook.variable.xxxx 允许你在书中使用和添加变量 !!!注意:此功能尚未实现!!!
版本 1.3.3
状态:未发布
- 新增通过 Vault 支持经济系统,你可以修改创建/编辑/使用 cmdbook 的价格
- cmdBook 更新器现在会检查与你当前 craftbook 版本匹配的最新版本
- 在配置中添加了 opPermissions,但可能无法完全正常工作
- 新增了基础权限结构:cmdbook.use.xxxx 和 cmdbook.variable.xxx 将会被更改 cmdbook.use.xxxx 允许你在书中使用变量 cmdbook.variable.xxxx 允许你在书中使用和添加变量 !!!注意:此功能尚未实现!!!
版本 1.3.2
状态:发布 - 小幅更新
- 新增 /cb variables 命令,列出所有可用变量
- 新增 cmdBook 更新器测试版(可能在不同 craftbook 版本间出现兼容性问题)
- 移除了配置文件中的版权符号以修复 Linux 下的错误
- 新增了一些配置选项,例如 "executeOnRead"
- 移除了所有与 /cmdbook 命令相关的内容,现已切换至 /cb
- 新增了基础权限结构:cmdbook.use.xxxx 和 cmdbook.variable.xxx 将会被更改 cmdbook.use.xxxx 允许你在书中使用变量 cmdbook.variable.xxxx 允许你在书中使用和添加变量 !!!注意:此功能尚未实现!!!
版本 1.3.1
状态:发布 - 重大更新
- 已在 Bukkit 1.4.7 R0.1 上更新并测试——仅适用于此版本
- 新增 /cb convert 命令以转换已过时的变量
- 将 calc(..) 更改为 $calc[..],请使用 /cb convert 命令在现有书籍中进行转换
- 新增 $msg[..] 用于私聊
- 新增 $broadcast[..] 用于全服广播
- 新增 $script[...] 支持 JavaScript 脚本,变量 'output' 将用于替换 $script[...] 的内容
- 在 msg、broadcast 和 input 中新增颜色支持
- 新增 @input[..],这将在书籍开始时提示用户输入 $input[..] 将在执行命令前提示用户输入
- 修复了多个错误(包括 cmd_split 的配置问题)
- 新增了基础权限结构:cmdbook.use.xxxx 和 cmdbook.variable.xxx 将会被更改 cmdbook.use.xxxx 允许你在书中使用变量 cmdbook.variable.xxxx 允许你在书中使用和添加变量 !!!注意:此功能尚未实现!!!
版本 1.3.0
状态:发布 - 重大更新
- 已在 Bukkit 1.4.6 R0.3 上更新并测试
- 添加了更新检测器
- 添加了配置(参见页面)- 可更改分隔符字符
- 新增:losx、losy 和 losz(视线位置)变量
- 添加了 @runconsole 和 @hidemessages(将它们放置在 cmdbook 中的任意位置即可,无需使用 cmd split)
- 添加了 /cb public 和 /cb private 命令,使书籍变为私有(适用于普通书籍)
- 修复了 calc() 错误、input() 错误以及首个命令错误
版本 1.2.0
状态:发布 - Mayor
- 已针对 Bukkit 1.4.6 R0.3 进行更新和测试
- 移除了更新程序(暂时)
版本 1.1.2
状态:发布 - Minor
- 已针对 Bukkit 1.4.2 R0.1 进行更新和测试
版本 1.1.1
状态:发布 - Bugfixes
- 添加了 $wait[integer],将 integer 替换为数字(毫秒),这将暂停命令执行
- 修复了与 CommandBook 插件的不兼容问题(由于 ./cmdbook 引起)
- 修复了一些错误
版本 1.1.0
状态:发布 - 包含 Mayor 的变更
- 添加了 calc(..+...) 用于执行基本计算(+、-、*、/)。您也可以使用返回整数的变量
- 新增变量:$lvl 、 $targetlvl 、 $xp 、$targetxp
- 新增 $input 变量:$input 会在运行命令前提示玩家 当使用 $input[在此输入问题] 时,效果相同,但会显示自定义消息
- 修复了多个错误(未手持书籍时的 /cb info 错误,以及一些性能错误)
- 添加了对 dev.bukkit 页面的更新检查支持(目前仅在控制台启动时生效)
版本 1.0.2
状态:发布
- 当您输入 || (双竖线)时,它不会被识别为聊天分隔符 因此您可以在命令中使用它
- 修复了 1.0.1 版本的 /cb info 错误
版本 1.0.1
状态:未发布
- 提供了一种通过将命令放在另一页上来分割命令的方法 IDEA: destroyer4017
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
自定义你的Minecraft头像!
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
评论 0
登录后参与评分
还没有评论,来抢沙发吧