promotional bannermobile promotional banner

Groovy World

world feature generator toolkit for groovyscript
Examples of ore veins generated by the "vanilla" and "randomizer" example scripts.

Examples of ore veins generated by the "vanilla" and "randomizer" example scripts.

Description

Groovy World provides a collection of tools for defining custom feature generators (ores, surface decorations, etc.) in GroovyScript.

You can register features with your own world generation logic in a closure:

mods.groovyworld.featureRegistry.addFeature("my_cool_feature") { rng, world, chunkMinX, chunkMinZ ->
    // randomly place one diamond ore block somewhere in the chunk
    world.setBlockState(
            new BlockPos(chunkMinX + rng.nextInt(16), rng.nextInt(64), chunkMinZ + rng.nextInt(16)),
            Blocks.DIAMOND_ORE.getDefaultState())
}

You can also assemble pieces of the Groovy World toolkit to quickly build more complex feature generators:

mods.groovyworld.featureRegistry.addFeature("my_awesome_feature", new FeatureBuilder()
        // only generate the feature in dimension 0 (the overworld)
        .setChunkFilter(ChunkFilters.dimension(0))
        // try to place the feature 4 times per chunk
        .setTriesPerChunk(4) 
        // distribute the feature uniformly between y=4 and y=32
        .setDistribution(FeatureDistributions.uniformY(4, 32))
        // only generate the feature if there is a stone block at the target position
        .setBlockFilter(BlockFilters.naturalStone())
        // paint a sphere of ore at the target position
        .setPainter(Painters.brush(
                BrushGeometries.sphere(2.5), // paint a sphere of radius 2.5
                BlockFilters.naturalStone(), // only paint the ore over stone blocks
                BlockPalettes.block(Blocks.DIAMOND_ORE, Blocks.GOLD_ORE))) // pick either diamond or gold for each ore
        .build())

For more information and examples, check out the GitHub repository.

Groovy World Team

profile avatar
  • 20
    Followers
  • 24
    Projects
  • 16.5M
    Downloads

More from phantamanta44View all