# Worldgen

Setup

{% tabs %}
{% tab title="Gradle" %}

```gradle
repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-worldgen:<VERSION>'
}
```

{% endtab %}

{% tab title="Kotlin" %}

```gradle
repositories {
    mavenCentral()
}

dependencies {
    modImplementation("dev.creoii.creoapi:creo-worldgen:<VERSION>")
}
```

{% endtab %}
{% endtabs %}

## FastNoise Implementation

## Density Function Types

### FastNoise

## Features

### Composite

<figure><img src="/files/fygieKejew1EGEzfMiUK" alt="" width="375"><figcaption></figcaption></figure>

Generates any number of features in the same spot.

There are three types of composite feature placement, defined under the **'type'** field.

* **free** places every feature in the list and returns true no matter what.
* **soft** returns true if at least one feature places.
* **hard** returns false if at least one feature fails.

#### Example

```json
{
  "type": "creo:composite",
  "config": {
    "type": "free",
    "features": [
      {
        "feature": "minecraft:spruce",
        "placement": []
      },
      {
        "feature": "minecraft:patch_berry_bush",
        "placement": []
      }
    ]
  }
}
```

This example will generate a spruce tree with a patch of berry bushes at the same position.

### Coral Claw

<figure><img src="/files/apLNA2MjTgYxeD3nl82R" alt="" width="375"><figcaption></figcaption></figure>

Generates a Coral claw shape.

{% code fullWidth="false" %}

```json
{
  "type": "creo:coral_claw",
  "config": {
    "to_place": {
      "type": "minecraft:simple_state_provider",
      "state": {
        "Name": "minecraft:stone"
      }
    }
  }
}
```

{% endcode %}

This example will generate a Coral Claw made completely of Stone.

### Coral Mushroom

<figure><img src="/files/6wKzeEiAXgvd2U0bHszi" alt="" width="375"><figcaption></figcaption></figure>

Generates a Coral mushroom shape.

```json
{
  "type": "creo:coral_mushroom",
  "config": {
    "to_place": {
      "type": "minecraft:simple_state_provider",
      "state": {
        "Name": "minecraft:stone"
      }
    }
  }
}
```

This example will generate a Coral Mushroom made completely of Stone.

### Coral Tree

<figure><img src="/files/qJoUDAAVJKwuRWHKhFg5" alt="" width="375"><figcaption></figcaption></figure>

The Coral Tree feature generates a Coral tree shape at the position.

```json
{
  "type": "creo:coral_tree",
  "config": {
    "to_place": {
      "type": "minecraft:simple_state_provider",
      "state": {
        "Name": "minecraft:stone"
      }
    }
  }
}
```

This example will generate a Coral Tree made completely of Stone.

### Crater

Generates a crater shape.

### Pool

<figure><img src="/files/JgRLGCsyG2BFuAg0jbqQ" alt="" width="375"><figcaption></figcaption></figure>

Generates a noise-based pool which is raised vertically. There are a number of parameters for this feature type:

* **'y\_offset'** specifies an offset to the pool's y-level.
* **'rim\_size'** specifies how thick the rim of the pool is.
* **'rim\_state'** specifies which block to use for the rim.
* **'inner\_state'** specified which block to use inside the pool.
* **'height'** specifies how tall the pool is.
* **'start\_radius'** specifies how wide the radius at the start of placement.
* **'inner\_depth'** specifies how deep the inside of the pool is and raises the floor accordingly.
* **'replaceable'** specifies which blocks can be replaced by the pool.
* **'solid\_rim'**, if true, fills in any gaps in the rim.

```json
{
  "type": "creo:pool",
  "config": {
    "y_offset": -1,
    "rim_size": {
      "type": "minecraft:uniform",
      "value": {
        "min_inclusive": 0,
        "max_inclusive": 2
      }
    },
    "rim_state": {
      "type": "minecraft:simple_state_provider",
      "state": {
        "Name": "minecraft:calcite"
      }
    },
    "inner_state": {
      "type": "minecraft:simple_state_provider",
      "state": {
        "Name": "minecraft:water",
        "Properties": {
          "level": "0"
        }
      }
    },
    "height": {
      "type": "minecraft:uniform",
      "value": {
        "min_inclusive": 2,
        "max_inclusive": 4
      }
    },
    "start_radius": {
      "type": "minecraft:uniform",
      "value": {
        "min_inclusive": 1,
        "max_inclusive": 2
      }
    },
    "inner_depth": {
      "type": "minecraft:uniform",
      "value": {
        "min_inclusive": 2,
        "max_inclusive": 4
      }
    },
    "replaceable": "#minecraft:base_stone_overworld",
    "solid_rim": true
  }
}
```

This example generates a Pool made of Calcite and filled with Water. It's start radius is either 1 or 2 and it rises between 2 and 4 blocks upwards.

### Spike

Generates a large Dripstone spike shape.

### Pillar

Generates a Basalt pillar shape.

### Rock

Generates a rock shape.

### Blob Spread

Generates a Glowstone blob shape.

### Fancy Spike

Generates an Ice Spike shape.

### Structure

Generates a structure nbt file.&#x20;

### Giant Log

<figure><img src="/files/VHs4tRFRrzMMu7i7QhXc" alt="" width="375"><figcaption></figcaption></figure>

Generates a giant log.&#x20;

## Material Conditions

### Density Function

### Exposed

### FastNoise

### Steep

## Placement Modifier Types

### All Of

A conditional placement modifier that takes a list of placement modifiers as input and returns true if all of those placement modifiers pass.

### Any Of

A conditional placement modifier that takes a list of placement modifiers as input and returns true if at least one of those placement modifiers passes.

### Density Function

A conditional placement modifier which returns true if the specified density function value at the block position is within the specified range.

### Distance From Zero

A conditional placement modifier which returns true if the block position is further from (0,0,0) than the specified distance.

### FastNoise

A conditional placement modifier which returns true if the specified FastNoise value at the block position is within the specified range.

### Height Filter

A conditional placement modifier that returns true if the height of the specified heightmap is between the two specified heigh providers.

### Near Structure

A conditional placement modifier which returns true if the block position is within range of the specified structure.

**Warning:** This placement modifier is expensive and will easily cause lag.

### Noise

A conditional placement modifier which returns true if the specified noise value at the block position is within the specified range.

### Not

A placement modifier which inverts the result of the input placement modifier.

### Offset

A positional placement modifier which offsets the block position by a specified amount.

### Random

A conditional placement modifier which returns true or false at random.

### Sky Visible

A conditional placement modifier which returns true if the sky is visible at the block position.

### Steep

A conditional placement modifier which returns true if the steepness value at the block position is within the specified range.

### Within Structure

A conditional placement modifier which returns true if the block position is within the specified structure.

**Warning:** This placement modifier is expensive and will easily cause lag.

## Structure Placement Types

### Density Function

### Distance From Pos

### FastNoise

### Fixed

A structure placement type that takes a list of block positions and attempts to generate the structure at each one.

### Noise

## Structure Processor Types

### FastNoise

### Noise

<figure><img src="/files/9BH0rOmbziBgFB8dpJD4" alt="" width="375"><figcaption></figcaption></figure>

```json
{
  "processor_type": "creo:noise",
  "noise": "minecraft:gravel",
  "min_threshold": 0.1,
  "max_threshold": 2
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.creoii.dev/creo-api/packages/worldgen.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
