Creoii Mod Documentation & Wiki
Creo API
Creo API
  • Overview
  • Setup
  • Packages
    • Block API
    • Block Injection API
    • Content Modification API
    • Convention Tags
    • Entity Attributes
    • Entity-Block Collision API
    • Events
    • Food Component API
    • Item API
    • Mod Compatibility API
    • Registry API
    • Shader Interaction API
    • Worldgen
Powered by GitBook
On this page
  • FastNoise Implementation
  • Density Function Types
  • FastNoise
  • Features
  • Composite
  • Coral Claw
  • Coral Mushroom
  • Coral Tree
  • Crater
  • Pool
  • Spike
  • Pillar
  • Rock
  • Blob Spread
  • Fancy Spike
  • Structure
  • Giant Log
  • Material Conditions
  • Density Function
  • Exposed
  • FastNoise
  • Steep
  • Placement Modifier Types
  • All Of
  • Any Of
  • Density Function
  • Distance From Zero
  • FastNoise
  • Height Filter
  • Near Structure
  • Noise
  • Not
  • Offset
  • Random
  • Sky Visible
  • Steep
  • Within Structure
  • Structure Placement Types
  • Density Function
  • Distance From Pos
  • FastNoise
  • Fixed
  • Noise
  • Structure Processor Types
  • FastNoise
  • Noise
  1. Packages

Worldgen

Features, surface rules, density functions, noise, and more to improve worldgen capabilities.

PreviousShader Interaction API

Last updated 1 year ago

Setup

repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-worldgen:<VERSION>'
}
repositories {
    mavenCentral()
}

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

FastNoise Implementation

Density Function Types

FastNoise

Features

Composite

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

{
  "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

Generates a Coral claw shape.

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

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

Coral Mushroom

Generates a Coral mushroom shape.

{
  "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

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

{
  "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

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.

{
  "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.

Giant Log

Generates a giant log.

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

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