Difference between revisions of "Command Book"
m |
m (→Obtaining) |
||
Line 14: | Line 14: | ||
The command book can only be obtained using the <code>/give</code> command. | The command book can only be obtained using the <code>/give</code> command. | ||
− | The command that the command book will run is specified | + | The command that the command book will run is specified with the <code>command</code> data tag. This can be set to any command. The <code>uses</code> data tag specifies how many times the command book can be used before it disappears. The <code>name</code> data tag can also be used on command books. |
− | For example, the command <code>/give command_book 1 0 {name:"Carrot Book", command:"/give carrot 10", uses: | + | For example, the command <code>/give command_book 1 0 {name:"Carrot Book", command:"/give carrot 10", uses:2}</code> gives a command book named "Carrot Book" which gives ten carrots when used and can be used twice before disappearing. |
== Usage == | == Usage == |
Revision as of 08:06, 11 May 2020
Command Book | |
---|---|
Type: | Creative Utility |
Stackable: | No |
Found naturally: | No |
Renewable: | No |
Identifier: | command_book |
The command book is an item that can only be summoned with commands, and issues commands when the player holds the book and shift-clicks.
Obtaining
The command book can only be obtained using the /give
command.
The command that the command book will run is specified with the command
data tag. This can be set to any command. The uses
data tag specifies how many times the command book can be used before it disappears. The name
data tag can also be used on command books.
For example, the command /give command_book 1 0 {name:"Carrot Book", command:"/give carrot 10", uses:2}
gives a command book named "Carrot Book" which gives ten carrots when used and can be used twice before disappearing.
Usage
The command book can be used to help make adventure maps easier to navigate and give players required resources, without the map player needing to type commands.
It also allows for faster command usage when using the same command repetitively, as the player does not need to open the command menu over and over again, and can just shift click the command book.
Running Commands
The command book can be used by shift clicking with it while holding it in the hand. This executes its command.
If the command book has been set a limited number of uses, this adds one use to its count. Once it is used the maximum specified number of times, it disappears. If a specific number of uses has not been set, the command book can be used an unlimited number of times.
Data Values
Main article: Data tags
Tag Name | Description | Values |
---|---|---|
name
|
Overrides the default naming of the item (as if it was renamed by an anvil) | String
Name of the command book |
command
|
Specifies the command run by a command book. | String
Command will not be checked for errors upon creation. |
uses
|
Specifies how many times a command book can be used before it disappears. | Integer
Non-positive numbers are invalid. If not specified, the number of uses is unlimited. |
History
Version | Date | Changes |
---|---|---|
1.28 | Oct 8, 2016 |
|