<OreBlock> and <Replaceable> Elements
The <OreBlock> element specifies a block or group of blocks that a distribution can spawn during generation. The <Replaces> element specifies a block or group of blocks that a distribution can replace during generation. Multiple ore blocks and replaceable blocks may be listed for a given distribution - each one adds to the list of placeable or replaceable blocks.
<OreBlock> and <Replaces> elements have the same attributes:
|block||[Required]||The blockID or internal name of the block to be placed/replaced. If a specific metaData value is required it can be appended with a colon, otherwise all metaData values for that block will match. A regular expression can be used to match groups of blocks with similar names.|
|weight||1.0|| For ore blocks, the probability that this block will be chosen to place. The total weight of all possible ore blocks must not exceed 1.0.
For replaceable blocks, the probability that this block will be replaced.
Using Regular Expressions
The regular expression capabilities are quite powerful. For example: the following two pieces of code accomplish exactly the same thing, but the single <Replaces> element using a regex string is simpler, easier to read, and could potentially be compatible with mod-added stair blocks.
<Replaces block='stairsWood'/> <Replaces block='stairsStone'/> <Replaces block='stairsBrick'/> <Replaces block='stairsStoneBrickSmooth'/> <Replaces block='stairsNetherBrick'/> <!-- identical to: --> <Replaces block='stairs.*'/>
An even more useful application of the regular expression matching is this code that replaces all blocks:
Note that, if necessary, the block ID can be used instead of the block name. Since block names are not always easy to guess, the ID is a foolproof way to identify a block:
<OreBlock block='1'/> <OreBlock block='35:14'/>
All blocks that match the block string are given the same weight. If a block matches more than one block string the weights are added together. Negative weights can be used to reduce the probability that a block will be placed/replaced.
For example, this code will match all blocks except water - all blocks match the first <Replaces> and thus have a weight of +1, but water also matches the second <Replaces> and thus its total weight is 0:
<Replaces block='.*' weight='1'/> <Replaces block='water' weight='-1'/>
List of Blocks
The following is a complete list of internal block names, as of Minecraft v1.4.5. Note that some names are shared between several blocks while other blocks have no name at all.