Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding custom worldtypes round 2 #84

Merged
merged 46 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
abab008
trying again
woodiertexas Feb 7, 2024
a3b730b
metadata
woodiertexas Feb 7, 2024
9e15a24
metadata pt2
woodiertexas Feb 7, 2024
6dca3d2
metadata pt3
woodiertexas Feb 7, 2024
d16107a
so linebreaks using </br> cause issues apparently
woodiertexas Feb 7, 2024
620148a
this preview feature is irritating me to no ends
woodiertexas Feb 7, 2024
b799cb2
fix typo
woodiertexas Feb 7, 2024
063ff9c
no draft
woodiertexas Feb 7, 2024
9411986
get the world types page to show in preview once and for all
woodiertexas Feb 7, 2024
8189f02
linebreaks except they actually work this time
woodiertexas Feb 7, 2024
41e429f
linebreaks except they actually work this time... again because they …
woodiertexas Feb 7, 2024
b06654b
linkebreaks round 3
woodiertexas Feb 7, 2024
e30ab1e
update file paths
woodiertexas Feb 7, 2024
1884ebc
add missing `{}` + bonus indentation edit
woodiertexas Feb 7, 2024
dd69a38
reword section about dimensions and dimension types
woodiertexas Feb 7, 2024
009f5b2
linebreak update
woodiertexas Feb 8, 2024
625c1c6
linebreak update 2: electric boogaloo
woodiertexas Feb 8, 2024
5a64b31
linebreak update 3: revenge of the line breaks
woodiertexas Feb 8, 2024
364083d
Update wiki/misc/world_types/en.md
woodiertexas Feb 8, 2024
92c62e7
Update wiki/misc/world_types/en.md
woodiertexas Feb 8, 2024
2dee30b
add world type examples
woodiertexas Feb 8, 2024
e0473c6
rework dimension explanation
woodiertexas Feb 8, 2024
d7d48ac
less repetition
woodiertexas Feb 8, 2024
a9b940b
add section headers
woodiertexas Feb 8, 2024
76b262e
Update wiki/misc/world_types/en.md
woodiertexas Feb 11, 2024
766c0dd
Update wiki/misc/world_types/en.md
woodiertexas Feb 11, 2024
e84dede
Update wiki/misc/world_types/en.md
woodiertexas Feb 11, 2024
3edd1c2
Update wiki/misc/world_types/en.md
woodiertexas Feb 15, 2024
b19642e
Update wiki/misc/world_types/en.md
woodiertexas Feb 15, 2024
39c490b
Update wiki/misc/world_types/en.md
woodiertexas Feb 15, 2024
89ebdb3
Update en.md
woodiertexas Feb 25, 2024
bd4db3a
Update en.md
woodiertexas Feb 25, 2024
4fd339c
rephrasing
woodiertexas Feb 25, 2024
553b8cd
Update en.md
woodiertexas Mar 3, 2024
dcde6e8
Update wiki/misc/world_types/en.md
woodiertexas Mar 4, 2024
ab57572
more stuff
woodiertexas Mar 4, 2024
b76dfd4
github and wonky formatting lol
woodiertexas Mar 4, 2024
6af94eb
yeefpineapple
woodiertexas Mar 5, 2024
253afbb
reformatting
woodiertexas Mar 10, 2024
bc1419d
fix link description
woodiertexas Mar 10, 2024
3daa209
reformatting 2: electric boogaloo
woodiertexas Mar 10, 2024
17a2d3d
rephrasing
woodiertexas Mar 10, 2024
581ed30
error fix and reformatting
woodiertexas Mar 10, 2024
863e45e
Update en.md
woodiertexas Apr 30, 2024
d69049a
Update wiki/misc/world_types/en.md
woodiertexas May 2, 2024
ae85731
Merge branch 'main' into main
OroArmor May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lib/translations/en/wiki.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
},
"sounds": {
"title": "Adding Sounds"
},
"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 `level-type`. It will have `minecraft\:normal` as the default value.
woodiertexas marked this conversation as resolved.
Show resolved Hide resolved

## Making your worldtype accessible
Copy link
Contributor

Choose a reason for hiding this comment

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

This section could use a note about how to select custom world types on a dedicated server (server.properties)

Copy link
Member

Choose a reason for hiding this comment

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

was this fixed? i dont see any reference to this


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.