This mod adds transportable, single use command blocks.
The vanilla command block allows map makers a lot of flexibility by triggering arbitrary commands in response to redstone signals. However in some cases it would be more natural to give the player a usable item to execute the command. Some possible uses:
- A teleport scroll.
- An instant buff item.
- A customized mob spawning egg.
I hoped such an item could be added to vanilla. Indeed this has been suggested before, and also requested as a mod.
This mod can act as a proof of concept to support a suggested addition to vanilla. It also should support basic functionality when running on a server with vanilla clients connected (doesn't work yet).
A blank command slate can be configured with commands and options, and used to produce command runes.
/give @p command_item:command_slate
Right click the slate to open a GUI. Enter the commands, title and description.
Customize options such as whether the item is consumed on use. Note: In creative mode the rune is never consumed.
Shift-click an item to set the appearance of the rune.
Finally take runes from the output slot.
Right click to use the rune.
Instead of using the GUI, you can also use /give to make runes. Examples:
/give @p command_item:command_rune 1 0 {cmd:{cmd:["tp @p ~ ~3 ~","tell @p Up!"]}}
/give @p command_item:command_rune 1 0 {cmd:{cmd:["time set 1000"],keep:1,duration:20},mimicItem:{id:"minecraft:clock"}}
/give @p command_item:command_rune 1 0 {cmd:{cmd:["particle heart ~ ~2 ~ .4 .4 .4 1 3"],keep:1,Name:"{text:Love,color:red,bold:true}"}}
/give @p command_item:command_rune 9 0 {cmd:{cmd:["give @p minecraft:diamond_sword"],stacksize:9},mimicItem:{id:"minecraft:diamond"}}
A configured command slate can be crafted directly into a rune.
A blank slate can be crafted with a book (containing commands, description and options) and another item (to determine the appearance).
Many resources were useful when writing this mod; some of them are
- Minecraft and Forge source code
- Tutorials by Bedrock_Miner
- Packet tutorial by coolAlias
- Packet tutorial by diesieben07
This section is essentially notes for myself...
- Add interrupt option (on damage taken)
- Allow vanilla client (ideas)
- Option 1: Intercept packets to client and translate mod items to vanilla items (with custom NBT)
- Option 2: Add "vanilla mode" mod configuration option, use vanilla items with NBT on client and server Shift-click doesn't combine stacks correctly (NBT mismatch on SP server)








