-Requires Risugami’s ModLoader
Most recent version: v2.5
* Configuration GUI added.
* Toggle and Change Blocks now look different as items.
* Buttons no longer look cut off at the bottom.
* Added Toggle Block Scanner item.
Toggle Blocks is a mod that allows you to affect blocks using redstone. It is a spiritual successor of the original ControllerBlock, rewritten from the ground up to be more versatile and to solve a few issues of the original.
Installing Toggle Blocks
See general install instructions above. Note: make sure you install the gui folder correctly too. There should be a changeblock.png, a toggleblock.png, a toggleblockassistant.png, and six cbalignment_*.png in that folder.
Using Toggle Blocks
(Make sure to watch this video and read the Basics section, at least.)
Basics
(The following sections explain all of this in greater detail.)
There are six types of Toggle Blocks in four different sizes:

(I forgot to mention it in the picture, but you get 3, 10, 25, and 50 Change Blocks, respectively, for each size.)
Setup:
- Place the Toggle Block to put it into Edit mode. (Note that you can have only one Toggle Block in Edit mode at any one time.)
- Open up the GUI with a right-click:

- Grab the Change Blocks. If desired, you can place blocks or items into the Quick-place slots. It’s intended mostly for setups where most of the blocks are of one type.
- Place the Change Block. Open its GUI with a right-click:

- Place blocks or items in the slots as desired. On and Off refer to the powered and unpowered states, respectively.
- When done, double-click the Toggle Block. If there are any errors, fix or ignore them and double-click again. Either way, the Toggle Block will switch to Ready mode, with the following occurrences:
- Any Change Blocks you have on you will be removed.
- Any blocks or items still in the Quick-place slots will be kicked out.
- Hook up a circuit to the Toggle Block.
- Enjoy!
Right-clicking a Ready mode Toggle Block will bring up this GUI:

You can change the radius to check for outside containers, plus there are replenishment slots so that outside containers aren’t necessarily needed. In order to hide a Toggle Block in the world:
- Click the corresponding button in the Ready mode GUI. (Make sure you have a free inventory slot!)
- With the given Toggle Block Assistant item, right-click on the block you want to disguise the Toggle Block as (note that, like Secret Switches, the targeted block must be opaque).
- Done!
If there are any problems, you will be notified and the Toggle Block will be in Error mode. When in Error mode, check the red-colored Change Blocks to fix. The Change Block GUI will show the error text.
The possible errors are:
- Empty Change Blocks
- Putting Toggle Blocks or other Change Blocks inside of a Change Block.
- Switching out a container with another block or item.
- Any empty Change Blocks will stay that way. This could be useful considering how Toggle Blocks handles encroaching blocks.
- Any contained Toggle Blocks will be kicked out, and any contained Change Blocks destroyed.
- If the replaced container had items in it, they will be kicked out.
Placing a Change Block sets its alignment. You can change it at any time by left-clicking the Change Block. Note that the alignment (and its subsequent block placement) is based off of which way you are looking:

You will have to get above or below the Change Block to set up/down alignment. Left-clicking the Change Block while the arrow is pointing away from you will turn it around to make it face you (and vice versa), useful for in-the-wall setups. The green check mark indicates the facing direction of the Change Block, the red X its opposite.
Alignment matters for the following vanilla blocks and items: (
- Torches (regular and Redstone)

- Stairs
- Furnaces and Dispensers
- Ladders
- Levers

- Buttons
- Doors
- Pumpkins and Jack-o-Lanterns
- Arrows, Eggs, and Snowballs

- Beds
- Redstone Repeaters
- Signs (Note that whether you’ll get a wall sign or a sign post depends on whether there is a block in the alignment direction.)
- Anything dropped as an item

Replenishment
If a block is destroyed, the Toggle Block will try to replenish it upon the next change to that respective state, in the following order:
- From the Change Block’s slot if more than one was put into the slot.
- From the Toggle Block’s own internal replenish inventory (filled via the Ready mode GUI).
- From any outside containers. These containers will be searched for in a square centered on and at the same altitude as the Toggle Block. The square’s radius is changeable via the Ready mode GUI, and the width of the square is (Container Checking Radius x 2 + 1).
Other containers can be added to the configuration for replenishment.
(Below is an example setup of Chests with the default container radius of 2.)


Use and Drop
Generally speaking, a Change Block set to Use will attempt to place or use the block or item. For items specifically:
- First, the Toggle Block will attempt to use the item as though you were right-clicking on a block with said item in hand.
- Second, the Toggle Block will attempt to use the item as before, but this time as though you were right-clicking into the air.
- Third, the Toggle Block will attempt to use ModLoader’s special dispenser functions. This supports mod items like Risugami’s Elemental Arrows. Note that up and down alignments won’t work here because dispensers (and, by implication, ModLoader’s dispenser functions) don’t support up and down.
The Drop function skips all of the above checks and drops the block or item. Certain items will drop regardless of whether the Change Block is set to Use, such as food and those set to drop in the configuration.
The following items in the Use state are specially handled and as such don’t go through the above checks:
- Water and Lava buckets (allows these to be used anywhere)
- Empty buckets (used as a placeholder where you can put water or lava without it being destroyed on next state change)
- Flint and Steel (due to special handling, see Configuration below)
- Arrows, Eggs, and Snowballs (allows up and down alignments)
- Boats (allows boats to be created anywhere)
- Signs (prevents the sign edit GUI from showing up)
The first time Toggle Blocks loads, it will create several configuration files, ToggleBlocks.properties in .minecraft/mods/ApatheticMods, and several others in the containing /ToggleBlocks folder. These files can be edited with any text editor. The settings available in ToggleBlocks.properties are:
- toggleblockid (Default 121): the Toggle Block’s block ID. Valid values for block IDs are any untaken IDs <= 255 (1023 if you’re using Minecraft Extended’s More Block IDs).
- changeblockid (Default 122): the Change Block’s block ID.
- maxcbdistance (Default 48): the maximum distance a Change Block can be placed from its owning Toggle Block. The valid range is from 1 to 127.
- moveflintandsteel (Default true): if this is true:
- When switching to Ready mode, the Toggle Block will move any found Flint & Steel inside the Change Blocks to nearby chests if there are any with empty slots.
- When a Change Block needs to use a Flint & Steel, it uses one in the chests without taking it away.
- centeritemid (Default 331, Redstone dust): the item to use in the center of each Toggle Block recipe.
- altmedironrecipe (Default false): when true, changes the medium Iron Toggle Block recipe to this:

- ignoreemptycb (Default false): when true, ignore empty Change Blocks when checking for errors.
- containercheckradius (Default 2): the default container checking radius for new Toggle Blocks or those converted from before v2.4. The valid range is from 0 to 5.
- containerblocks (Default 54): a comma-delimited list of block IDs to use for container checking when searching for items to replenish. These containers will also be used for storing Flint & Steel if moveflintandsteel is true.
- assitantitemid (Default 12100): the item ID for the Toggle Block Assistant Item. Valid values are any untaken item IDs from 400 to 31999.
- stacktoggleblocks (Default false): when true, allows Toggle Blocks to stack up to 16. Note that you won’t get the center item back when deconstructing or creating a Large Toggle Block from two Medium when this is set to true. Beware when changing this setting from true to false, as the center item rules apply and you might lose a whole stack of Toggle Blocks if you’re not careful.
#---Toggle Blocks--- #Sat Jun 11 02:49:11 EDT 2011 toggleblockid=121 changeblockid=122 maxcbdistance=48 moveflintandsteel=true centeritemid=331 altmedironrecipe=false ignoreemptycb=false containercheckradius=2 containerblocks=54 assistantitemid=12100 stacktoggleblocks=falseFor block and item properties, you can use the in-game Configuration GUI. Click the “+” button above any of the other GUI’s to access it.


To set block information:
- Click the respective block in the list.
- Click on the respective check boxes (if you don’t know the save flags, use the Toggle Block Scanner [see below]).
- Although it is unlikely, as Toggle Blocks usually automatically deduces them, if you need to set expected blocks:
- Click on the “Add Blocks” button.
- Click on the blocks you want to add. If you accidentally add an incorrect block, you can click on its entry in the right-hand list to remove it. There is a limit of 5 expected blocks.
- If you want to force an item to have no expected blocks (used for dyes to prevent bonemeal from adding expected blocks), make sure the list is clear and click “None”. The text should change to “Set to None!”.
- Click on “Click When Done” or “Save” when done.
- Click on “Save” to save the settings.
The Scanner text shows the block’s ID, name, location, and metadata bits that correspond to those in the Configuration GUI (remember that for any blocks that are placed via items, like doors and beds, you need to set the item flags for the item itself). You can remove a block from being scanned by any one of the following:
- Right-clicking on that block.
- Destroying the block.
- Clicking “Remove Scanner” in the Configuration GUI.
- Put a Toggle Block into the crafting window to get back the iron or gold used to make it (You also get the center item back if Toggle Blocks aren’t set to be stackable in the configuration).
- You will not enter the Change Block GUI with another Change Block in hand, and will instead place it. This is useful for easily placing one Change Block against another.
- Anything dropped as an item will drop it as a stack. You can customize this by putting stacks of whatever size you want into the chests surrounding the Toggle Block.
- If another type of block is encroaching on an occupied spot, it will be kicked out as an item upon the next state change.
- If seeds are being planted and the below block isn’t tilled, the Toggle Block will search the chests for a hoe to till the soil, using it up in the process.
- The GUI and textures could use some love. Anyone who could improve on them might get them included into the next version (with credit, of course).
- This mod by default uses block IDs 121 (Toggle Block) and 122 (Change Block).
None as of right now.
Videos
These videos demonstrate a few things that can be done with Toggle Blocks.
nhg1 shows off a house using Toggle Blocks to make gates and hidden passageways:
Minecrafter9 made this 20×20 pixel color TV using Toggle Blocks and Pistons:
kamtschatka made this automatic tree farm using Toggle Blocks and the Allocator:
moldy912 made this garage door that functions like the real thing (with stepped block placement and removal instead of all at once):
Download Link:
http://www.mediafire.com/?tudlgcc1qgh7ztn