Page last edited 1,739 days 8 hours ago
From COG Docs
Jump to: navigation, search

<Biome> Elements

The <Biome> element specifies a biome or group of biomes that a distribution can spawn in. Multiple biomes can be listed for a given distribution - each one adds to the list of valid biomes.

<Biome> elements have two attributes:

Attribute Default Value Description
name [Required] The name or ID of the biome. Regular expressions can be used to match multiple biomes at once.
weight 1.0 The probability that the distribution will generate in this biome. See the Weights section below.

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 version using regex strings is simpler, easier to read, and could potentially be compatible with mod-added taiga/ice/frozen biomes.

 <Biome name='Taiga'/>
 <Biome name='TaigaHills'/>
 <Biome name='Ice Plains'/>
 <Biome name='Ice Mountains'/>
 <Biome name='FrozenOcean'/>
 <Biome name='FrozenRiver'/>
 <!-- identical to -->
 <Biome name='Taiga.*'/>
 <Biome name='Ice.*'/>
 <Biome name='Frozen.*'/>

An even more useful application of the regular expression matching is this code that matches all biomes:

 <Biome name='.*'/>


All biomes that match the name string are given the same weight. If a biome matches more than <Biome> element then the weights are added together. Negative weights can be used to reduce the probability for a biome.

For example, this code will match all biomes except the nether. All biomes match the first <Biome> and thus have a weight of +1, but the Nether also matches the second <Biome> and thus its total weight is 0:

 <Biome name='.*' weight='1'/>
 <Biome name='Hell' weight='-1'/>

The total weight for each biome (the sum of the weights from all matching <Biome> elements) is the probability that an attempt to place a distribution in that biome will succeed. A total weight of zero (or negative) means that attempts will always fail. A total weight of 1.0 (or anything greater than 1.0) means that attempts will always succeed. The number of "attempts" is determined by the base distribution frequency. <Biome> elements can make a distribution 'less' common in a biome, but not 'more' common.

List of Biomes

The following are valid vanilla biome names, as of Minecraft 1.4.5:

Biome ID Name
0 Ocean
1 Plains
2 Desert
3 Extreme Hills
4 Forest
5 Taiga
6 Swampland
7 River
8 Hell
9 Sky
10 FrozenOcean
11 FrozenRiver
Biome ID Name
12 Ice Plains
13 Ice Mountains
14 MushroomIsland
15 MushroomIslandShore
16 Beach
17 DesertHills
18 ForestHills
19 TaigaHills
20 Extreme Hills Edge
21 Jungle
22 JungleHills