Block Descriptors

Page last edited 1,772 days 13 hours ago
From COG Docs
(Redirected from Replaces)
Jump to: navigation, search

<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:

<OreBlock> and <Replaces>
Attribute Default Value Description
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:

 <Replaces block='.*'/>

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'/>


Weights

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.

BlockID Name
0 air
1 stone
2 grass
3 dirt
4 stonebrick
5 wood
6 sapling
7 bedrock
8 water
9 water
10 lava
11 lava
12 sand
13 gravel
14 oreGold
15 oreIron
16 oreCoal
17 log
18 leaves
19 sponge
20 glass
21 oreLapis
22 blockLapis
23 dispenser
24 sandStone
25 musicBlock
26 bed
27 goldenRail
28 detectorRail
29 pistonStickyBase
30 web
31 tallgrass
32 deadbush
33 pistonBase
34 no name
35 cloth
36 no name
37 flower
38 rose
39 mushroom
40 mushroom
41 blockGold
42 blockIron
43 stoneSlab
44 stoneSlab
45 brick
46 tnt
47 bookshelf
48 stoneMoss
BlockID Name
49 obsidian
50 torch
51 fire
52 mobSpawner
53 stairsWood
54 chest
55 redstoneDust
56 oreDiamond
57 blockDiamond
58 workbench
59 crops
60 farmland
61 furnace
62 furnace
63 sign
64 doorWood
65 ladder
66 rail
67 stairsStone
68 sign
69 lever
70 pressurePlate
71 doorIron
72 pressurePlate
73 oreRedstone
74 oreRedstone
75 notGate
76 notGate
77 button
78 snow
79 ice
80 snow
81 cactus
82 clay
83 reeds
84 jukebox
85 fence
86 pumpkin
87 hellrock
88 hellsand
89 lightgem
90 portal
91 litpumpkin
92 cake
93 diode
94 diode
95 lockedchest
96 trapdoor
97 no name
BlockID Name
98 stonebricksmooth
99 mushroom
100 mushroom
101 fenceIron
102 thinGlass
103 melon
104 pumpkinStem
105 pumpkinStem
106 vine
107 fenceGate
108 stairsBrick
109 stairsStoneBrickSmooth
110 mycel
111 waterlily
112 netherBrick
113 netherFence
114 stairsNetherBrick
115 netherStalk
116 enchantmentTable
117 brewingStand
118 cauldron
119 no name
120 endPortalFrame
121 whiteStone
122 dragonEgg
123 redstoneLight
124 redstoneLight
125 woodSlab
126 woodSlab
127 cocoa
128 stairsSandStone
129 oreEmerald
130 enderChest
131 tripWireSource
132 tripWire
133 blockEmerald
134 stairsWoodSpruce
135 stairsWoodBirch
136 stairsWoodJungle
137 commandBlock
138 beacon
139 cobbleWall
140 flowerPot
141 carrots
142 potatoes
143 button
144 skull
145 anvil