Veins

The Veins algorithm creates narrow spidery distributions that keep player moving while mining.

## Veins Algorithm

The Veins algorithm creates a round central "motherlode" with branches radiating in all directions. The branches are composed of short straight "Segments" which are joined end-to-end in a chain extending away from the motherlode. Branches may fork, and the forks may themselves fork and so on, creating a tree structure rooted at the motherlode.

There are two distinct types of branches. For **Ellipsoid** branches the ore is placed in an ellipsoid (a 3D oval) along each segment. The segments are therefore thickest in the middle and thinest at the ends where they meet. These branches are faster to generate but are not very smooth. For **Bezier** branches, the ore is placed in a tube that curves smoothly from segment to segment. These branches are slower to generate but tend to be much easier to follow underground.

The <Veins> element creates a distribution using the veins algorithm. The <VeinsPreset> element creates a non-generating distribution that can be used as a source of default settings. <Veins> elements support all of the standard distribution features.

## Attributes

The Veins algorithm may have the following attributes:

\* These attributes are only meaningful in debugging mode.
## Settings

The Veins algorithm has the following settings:

## Ore Blocks

<OreBlock> elements can be used to specify a mixture of ore blocks to spawn with fractional weights. The total weight of all ore blocks must be less than 1.0.

## Replaces

<Replaces> elements can be used to change which blocks a Veins distribution will replace (the default is just smooth stone).

## Biome

<Biome> elements can be used to customize which biomes a Veins distribution will spawn in (the default is all biomes).

## Parents and Nesting

A <Veins> element may be placed *inside* another Veins, Cloud, or StandardGen element. The parent distribution will continue to spawn normally, but the child will **only spawn near it's parent**. More accurately, the child distribution Motherlodes will only spawn near the motherlodes, clouds, or clusters of the parent distribution. The exact range is determined by the *MotherlodeRangeLimit* setting.

## Example

```

<!-- A veins distribution named "SnowVeins" -->
<!-- All defaults are inherited from "PresetLayeredVeins", which must be defined somewhere above -->
<!-- The branch type is Bezier -->
<Veins name='SnowVeins' inherits='PresetLayeredVeins' branchType='Bezier'>

 <!-- These veins will place a 50/50 mixture of snow and ice -->
 <OreBlock block='snow' weight='0.5'/>
 <OreBlock block='ice' weight='0.5'/>

 <!-- The frequency is 0.025 motherlodes/chunk, scaled by the "oreFreq" option -->
 <!-- The height ranges from 32.5 to 53.5, but is most like to be near y=43 -->
 <Setting name='MotherlodeFrequency' avg=':= 0.025 \* oreFreq'/>
 <Setting name='MotherlodeHeight' avg='43' range='10.5' type='normal' />

 <!-- These veins will only spawn in Taiga biomes -->
 <Biome name='Taiga'/>

 <!-- They will replace stone 100% of the time,
 but dirt and gravel only 50% of the time -->
 <Replaces name='stone'/>
 <Replaces name='dirt' weight='0.5'/>
 <Replaces name='gravel' weight='0.5'/>

 <!-- A child distribution. It will only spawn near the parent. -->
 <Veins name='ChildDistribution' block='ice'/>

</Veins>

```