Skip to content

addavriance/TerraMath

Repository files navigation

TerraMath [Fabric/Forge] 1.20.x - 1.21.x

TerraMath_preview

CurseForge Modrinth

Fabric API Minecraft

Join the Discord to share formulas or find new ones.


Features

  • Define terrain height with any math formula using x, y, z coordinates
  • 50+ built-in functions: trig, hyperbolic, power, noise, random and more
  • Configurable noise overlay (Perlin, Simplex, Blended, Normal)
  • Adjustable generation parameters (scale, height, variation, smoothing)
  • Real-time 3D formula preview in the settings screen
  • Works on both client (world creation) and server (config file)

Quick Start

  1. Go to the World tab in the world creation screen
  2. Click Terrain Settings
  3. Enter a formula — for example: sin(x) * cos(z) * 10
  4. Adjust scale, height and noise parameters as needed
  5. Create the world

Full function reference: Wiki

Formula Examples

  • Basic wavy landscape: sin(x)image
  • Rolling mountains: sin(x/8)*cos(z/8)*10 + abs(sin(x/20))*15 + sqrt(abs(x/10))*5image
  • Terraced landscape with plateaus: floor(sin(x/20) * cos(z/20) * 5) * 4 + sqrt(x^2 + z^2)/10image
  • Spiky volcanic terrain: abs(sin(x/10))*exp(cos(z/15))*8 + tanh(sqrt(x^2 + z^2)/20)*15image
  • Crater-filled terrain: 10 * (1 - exp(-((x/30)^2 + (z/30)^2) / 2)) + 5 * perlin(x/50, 0, z/50)image
  • Heavy stepped terrain: round(sin(x/15))*10 + round(cos(z/15))*10 + sqrt(abs(sin((x+z)/20)))*15image

Server Setup

  1. Install the mod on the server
  2. Edit config/terramath.json, or configure on a client and copy the file over
  3. Set "useDefaultFormula": true for the config to apply to new worlds
  4. Restart the server and generate a new world

Known Issues

  • Extreme formulas producing very large terrain features may impact performance
  • Random functions (rand, randnormal, randrange) can cause chunk loading slowdowns — use sparingly

Contributing

Bug reports and feature suggestions are welcome via the issue tracker.

About

Custom world generation via math functions

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages