Skip to content

Commit

Permalink
adding custom worldtypes round 2 (#84)
Browse files Browse the repository at this point in the history
* trying again

* metadata

* metadata pt2

* metadata pt3

* so linebreaks using </br> cause issues apparently

* this preview feature is irritating me to no ends

* fix typo

* no draft

* get the world types page to show in preview once and for all

* linebreaks except they actually work this time

* linebreaks except they actually work this time... again because they broke

* linkebreaks round 3

* update file paths

* add missing `{}` + bonus indentation edit

* reword section about dimensions and dimension types

* linebreak update

Co-authored-by: anonymous123-code <[email protected]>

* linebreak update 2: electric boogaloo

Co-authored-by: anonymous123-code <[email protected]>

* linebreak update 3: revenge of the line breaks

Co-authored-by: anonymous123-code <[email protected]>

* Update wiki/misc/world_types/en.md

Co-authored-by: anonymous123-code <[email protected]>

* Update wiki/misc/world_types/en.md

Co-authored-by: anonymous123-code <[email protected]>

* add world type examples

* rework dimension explanation

* less repetition

* add section headers

* Update wiki/misc/world_types/en.md

Co-authored-by: anonymous123-code <[email protected]>

* Update wiki/misc/world_types/en.md

Co-authored-by: anonymous123-code <[email protected]>

* Update wiki/misc/world_types/en.md

Co-authored-by: anonymous123-code <[email protected]>

* Update wiki/misc/world_types/en.md

Co-authored-by: ix0rai <[email protected]>

* Update wiki/misc/world_types/en.md

Co-authored-by: ix0rai <[email protected]>

* Update wiki/misc/world_types/en.md

Co-authored-by: ix0rai <[email protected]>

* Update en.md

* Update en.md

* rephrasing

* Update en.md

* Update wiki/misc/world_types/en.md

Co-authored-by: ix0rai <[email protected]>

* more stuff

* github and wonky formatting lol

* yeefpineapple

Co-authored-by: ix0rai <[email protected]>

* reformatting

Co-authored-by: anonymous123-code <[email protected]>

* fix link description

Co-authored-by: anonymous123-code <[email protected]>

* reformatting 2: electric boogaloo

Co-authored-by: anonymous123-code <[email protected]>

* rephrasing

Co-authored-by: anonymous123-code <[email protected]>

* error fix and reformatting

Co-authored-by: anonymous123-code <[email protected]>

* Update en.md

* Update wiki/misc/world_types/en.md

Co-authored-by: Eli Orona <[email protected]>

---------

Co-authored-by: anonymous123-code <[email protected]>
Co-authored-by: ix0rai <[email protected]>
Co-authored-by: Eli Orona <[email protected]>
  • Loading branch information
4 people committed May 4, 2024
1 parent 13dc28a commit b50375b
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/translations/en/wiki.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
},
"mappings": {
"title": "Customizing your Mappings"
}
},
"world_types": {
"title": "Adding World Types"
}
}
}
2 changes: 2 additions & 0 deletions wiki/misc/world_types/+page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title: wiki.misc.world_types.title
index: 0
81 changes: 81 additions & 0 deletions wiki/misc/world_types/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: Adding a Custom World Type
index: 0
---

# Adding custom world types
If your mod completely overhauls Minecraft's worldgen, you'll likely want to create a custom worldtype to offer users the option to use your worldgen or vanilla Minecraft's world generation.
Now, what is a custom world type you may ask? *World types*, also called *world presets*, define world generation options for Minecraft worlds. They let you change the make-up of your Minecraft worlds by configuring how world generation behaves.

Some examples of world types already built into Minecraft are "Amplified", "Super Flat", "Single Biome", and "Large Biomes".

## Specifying which dimensions your world type applies to

The following block shows how to specify which dimensions your world type will apply to. In `dimensions`, a `minecraft:overworld` object is required.
The dimension `type` can be a built-in preset or a custom dimension preset you implement in your mod.


`src/main/resources/data/minecraft/example_mod/worldgen/world_preset`:
```json
{
"dimensions": {
"minecraft:overworld": {
"type": "example_mod:example_mod_dimension_type"
}
}
}
```

## Configuring how the worldgen works in your worldtype

`generator` is where you specify how the worldgen in your world type behaves. The `type` is a "generator ID" and the following are valid generator IDs:
- `noise`
- `flat`: Creates a superflat world (not really applicable here)
- `debug`: Creates a debug world (not really applicable here)

In `biome_source`, you specify how biomes generate. The `type` parameter here is what kind of biome generation will be used.
Valid generation types:
- `multi_noise`: Similar to overworld generation
- `fixed`: Like selecting "Single Biome" in world creation
- `the_end`: This is the generation the end dimension uses (not really applicable here)
- `checkerboard`: Places biomes in a checkerboard style

If the biome source `type` is `minecraft:multi_noise`, Minecraft will use 3D biomes in the overworld and the nether.
The `preset` can be `minecraft:overworld` or `minecraft:nether`. More info about this can be found [in the article about custom dimensions in the Minecraft wiki](https://minecraft.wiki/w/Custom_dimension#Multi-noise_biome_source_parameter_list).

`src/main/resources/data/minecraft/example_mod/worldgen/world_preset/example_mod_preset.json`:
```json
{
"dimensions": {
"minecraft:overworld": {
"type": "minecraft:overworld",
"generator": {
"type": "minecraft:noise",
"biome_source": {
"type": "minecraft:multi_noise",
"preset": "minecraft:overworld"
}
}
}
}
}
```
This will generate a world relatively similar to that of 's default overworld generation.

On a dedicated server, you navigate to your `server.properties` file and find the `level-type` field. By default, the value is `minecraft:normal`. Changing this to the ID for your world type (`example_mod:example_mod_preset`) will use that instead.

## Making your worldtype accessible

In order for your world type to show in the "create a new world" screen, you will need to make a file called `normal.json` in `resources/data/minecraft/tags/worldgen/world_preset` and populate it with the following.

`src/main/resources/data/minecraft/tags/worldgen/world_preset/normal.json`:
```json
{
"values": [
"example_mod:example_mod_preset"
]
}
```
This will make your world type show up in the world creation screen.

Alternatively, if you want your world type to only show as an option while the user is holding down ALT, make a file called `extended.json` in the same directory as your `normal.json` file.

1 comment on commit b50375b

@Cozy-GitHub
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See preview on Cloudflare Pages: https://554f550c.developer-wiki.pages.dev

Please sign in to comment.