[Outdated Use Ore Topic] CommandBooks - Like Signs? Try Books!

#CommandBooks - Simple Command Books Github All Releases GitHub issues license

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.command.create
commandbooks.use

##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].

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!

2 Likes

Might it be possible to keep normal @p functionality, instead of a direct string replace? For instance, a usage of @p[score_thirst=5] would not work, nor would /execute @e[type=Creeper] ~ ~ ~ tp @p @e[c=1].

Sure I can do that! Any suggestions for a Dropin for player name instead? I was thinking {PLAYER_NAME} though it’s a bit long.

#I broke it! Github Releases (by Release)

Release v1.1.0

Minecraft 1.10.2 - Tested on spongevanilla-1.10.2-5.1.0-BETA-366

Changes:

  • Changed player name drop-in from @p to [p] to avoid conflicting with default Minecraft selector functionality.

Enjoy

@pie_flavor Try that instead! :slight_smile:

is this intended to be stored via other plugins such as a kit plugin to save the book for later use or will there be some kind of storage within this plugin? ie. /cb list

It’s intended to be stored via other plugins, it should be able to be saved in kits, shops, ect. The idea is it’s meant to be disposable so no global storage.

biggest bug that i can find with this plugin is that the books can stack; and upon using up all uses it will remove all of the books.

Hmm, you’re right! Didn’t think about that, I’ll look into making it so they don’t stack. :slight_smile:

#End the Spam! Github Releases (by Release)

Release v1.2.0

Minecraft 1.10.2 - Tested on spongevanilla-1.10.2-5.1.0-BETA-366

Changes:

  • Command Books are now transformed into Enchanted Books when created to prevent them from stacking
  • Command Books are now triggered with a primary-click instead of a secondary-click to prevent accidental double-uses

Enjoy!

@Khaoz Shouldn’t have to worry about stacking books now :slight_smile:

tried the update; commands no longer are getting executed nor is the book being used up.

What version of sponge are you on? Are there any error messages in the console? (If so please link a pastebin for them)

spongeforge-1.10.2-2171-5.1.0-BETA-2000.jar

I looked to see if there were errors and didnt find any. it will create the book but upon right clicking to ‘use’ nothing happens. attempted with the example commands at the top and nothing happened either to see if it was a screw up on my end but nope; just doesnt work,

From the changenotes of release 1.2.0:

Try left-clicking :stuck_out_tongue:

CommandBooks now has an ore project page here! Please continue all discussion of CommandBooks there :smile:

Please use the Ore page for further discussion :slight_smile: