This is a discussion topic for the Ore project, CommandBooks. View the full project on Ore for downloads and more information.
CommandBooks
A simple Minecraft Command Book Plugin
Commands
/cb - Displays version information about the CommandBooks Plugin. (Aliases: cb, commandbooks) /cb create [uses] - Creates a Command Book from the book currently held in your main hand with an optional max number of uses
To create a Command Book simply open a regular Minecraft book and type into it the commands you would like to be executed by the book and sign it.
Commands can be multiple lines, however new commands should start on a new line.
To have a command be executed by the console instead of the player prefix it with $.
To use the player’s name inside a command use [p]. To use the player’s world use [w].
Example:
$time set day
$op [p]
say I've set the time to day and opped myself!
This book would have the console set the time to day, op the player, and then the player would send a message to the chat.
Finally, to create the command book, hold the book in your main hand and execute /cb create.
The title of the book should become encased in square brackets to signify the command book has been created.
When creating the book you can optionally specify a max number of uses Ex: /cb create 5 to limit the amount of times a book can be used.
Once all the uses are used up, the book will be destroyed.
Using a Command Book
To use a command book simply hold it in your hand and left-click!
Support Me
I will never charge money for the use of my plugins, however they do require a significant amount of work to maintain and update. If you’d like to show your support and buy me a cup of tea sometime (I don’t drink that horrid coffee stuff :P) you can do so here
Is there anyway you could add some kind of variable for delaying commands?
I’m using this in a book
$spawn other [p] safarizone
$ci [p]
$give [p] pixelmon:safari_zone 32
well it teleports the player, clears the inv, and gives the item and in console it looks like its in the above order but the items are not being given they instantly vanish before they go into the inv I’ve also tried it with
$kit give [p] safari
but if i put the above command in the book alone it does give the items the correct way without removing it so the clearinv command is the one breaking the concept.
@Khaoz Hmmm, that’s strange. I’ll do some testing and look into this.
@MageFX This plugin doesn’t provide that functionality, however, if you use a kit plugin, so long as it supports custom item data, you should be able to add command books to kits and give them that way! I’m not sure what you mean by abilities, could you provide some more detail?
When starting the server i get the following message
[07:28:59] [Server thread/WARN] [Sponge]: A custom DataBuilder is not extending AbstractDataBuilder! It is recommended that the custom data builder does extend it to gain automated content versioning updates and maintain simplicity. The offending builder’s class is: class io.github.zerthick.commandbooks.data.commandbook.builder.CommandBookDataManipulatorBuilder
Ah, that’s because you are on API 6 and I have not yet updated CommandBooks to reflect changes in the serialization API, this will be fixed once I make the update. For now, CommandBooks only officially supports API 5 (1.10).
Any kit plugin that handles “NBT” data should be suitable for your needs. I believe the kits in Nucleus can do this, however if you’d like a dedicated kit plugin you could try BetterKits
Is it possible that the user gives a name to the plugin?
For example,
$time set day
$op [p]
say I’ve set the time to day and opped myself!
Currently, after the user used the command book, he will op himself. Is it possible for the user to give another player’s name? Likely, the user right-clicks the command book and then types a user’s name in chat, and the plugin will op the user given by the user.
No, currently command books cannot prompt the user for input, such a feature would most likely need to wait until the Coversation API is added to Sponge. I will caution you however, allowing the user to potentially enter input into scripts can be very dangerous if not done properly, take the example you described above, it would allow someone who possesses the book to be able to op anyone on the server. Just something to consider.
Hi, I really like this plugin and hope to keep it in our server, but I started using grief prevention for the sky claims plugin, and sadly I discovered that grief prevention has a /claim bank or /cb command that overrides the commandbook /cb command. I was wondering if there was a way to change the command or at least have it take priority over the griefpreventions claimbank setup I don’t even have enabled. Thanks!
Glad you like the plugin! Sponge already provides this functionality, take a look at the aliases section of Sponge’s global.conf. You can also use /commandbooks insead of /cb
Ok, you are awesome for actually responding and so soon! Though I will admit embarrassingly, I had thought that the plugin was added, to find out that I removed it accidentally when removing the commandcraft plugin (was trying out new plugins). So once I found that out and actually the plugin, which has become one of my favorites so far, /cb works just fine haha. Sorry for the incompetence, and thanks again for the help, and for the plugin! It has been a lifesaver in so many ways!