|This Article is up to date with Custom Stuff 2|
These are attributes exclusive to slab-type blocks. An example setup for these attributes is:
doubleSlabId = config.getBlockId("exampleSlabID"); doubleSlabMeta=2;
Note that you only need the doubleSlabMeta if the double slab block you're using has a Metadata. In addition, although a slab-type block can only have eight total metadata values (0-7), a double slab is a normal-type block, and thus can have a full 16 metadata values. This means you can use a single block ID for two block IDs worth of slabs.
Setting up a Double Slab
In order to make slabs stack, you must have a "Double Slab" block set up. This block needs to be a different ID since it must have a different type. Usually you'll want this to be a normal type block.
The double slab block should generally use the same texture files as the slab it's from. Textures set up in this way should keep in mind that the sides of a slab block only use the bottom half of the texture index it references. Likewise, a slab placed in the upper half of the block's space will use the top half of a side-facing texture.
The other big thing to consider is how you set up the drop attribute of the double slab block. If you're mimicking the vanilla slabs, you'll want to have these attributes set to drop two of the slab, rather than the double slab itself (which is the default).
Here is the double slab block code to go with the example shown on the slab page.
id = config.getBlockId("cobaltDoubleSlabID"); name = "cobaltDoubleSlab"; material = "iron"; stepSound = "metal"; creativeTab = "buildingBlocks"; pick = config.getBlockId("cobaltSlabID"); displayName = "Cobalt Double Slab"; hardness = 5; resistance = 30; drop = config.getBlockId("cobaltSlabID") + ":0 2"; toolClass = "pickaxe"; harvestLevel = 2; textureFileXP = "cobaltSlab.png"; textureFileXN = "cobaltSlab.png"; textureFileYP = "cobaltBlock.png"; textureFileYN = "cobaltBlock.png"; textureFileZP = "cobaltSlab.png"; textureFileZN = "cobaltSlab.png"; addToCreative = true; toolClass = "pickaxe"; harvestLevel = 2;
Example Double Slab (CS1)
In Custom Stuff 1, you can use the doubleSlabId and DoubleSlabDamage attributes on your slab block file to create a double slab. Here is an example of how those attributes will look:
And here is the accompanying double slab, normal-type block file:
name="Obsidian Double Slab"; id=229; texturefile="terrain.png"; textureindex=183; textureindexnorth=37; textureindexsouth=37; textureindexeast=37; textureindexwest=37; type="normal"; material="rock"; stepsound="stone"; hardness=50; resistance=6000; iddropped=230; quantitydropped=2;