CommandBooks - A simple Command Book plugin


#1

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

Permissions

commandbooks.use
commandbooks.command.info
commandbooks.command.create

Creating a Command Book

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


#2

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.


#3

HI Is it possible to create and give a book via a server command?

Something like /cbgive or if books can be saved somehow and then given via a /cbgive ?

I realise this could be complicated just wondering if it's possible.

I'm also wondering if chance abilitys can be added?


#4

@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! :smiley: I'm not sure what you mean by abilities, could you provide some more detail?


#5

Say I wanted to put 5 commands in a book but only have 1 executed randomly. So u have like a 1/5 chance of something?


#6

Currently not possible, but it's certainly something I can look into. :slight_smile:


#7

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

went there something wrong?


#8

What version of sponge are you running?


#9

I´m on Version 1.11, SpongeForge (sponge-build 2004, forge-build 2195)


#10

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).


#11

A new version has been released for CommandBooks, it is available for download here.


Did someone say API 6?

Release v1.4.0

Minecraft 1.11.2 - Tested on spongeforge-1.11.2-2282-6.0.0-BETA-2297

Changes:

  • Updated to Sponge API 6.0

Enjoy!


#12

Please add so I can give books with a command. Or if you know a kit plugin that can do it. Please link it here :slight_smile:


#13

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 :slight_smile:


#14

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.


#15

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.


#16

Thank you very much. I just want to grant the players the permission to promote someone to the specific permission group.


#17

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!


#18

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 :wink:


#19

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!


#20

Is there any way to add a limit amount of how many time the player can use the book? If not I think that would be a great feature.