Fluid registry

This commit is contained in:
2026-10-25 14:05:57 -03:00
parent 0cfa4d9b4a
commit 17d83acfc8
18 changed files with 144 additions and 17 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
# Registries
Every block, item, block model, entity, entity model, status effect and texture has an id, and is registered under it
once, while mods load. After that the game refers to things only by their id.
Every block, item, block model, entity, entity model, status effect, fluid and texture has an id, and is registered
under it once, while mods load. After that the game refers to things only by their id.
## Identifiers
@@ -32,9 +32,9 @@ The server and every client load mods the same way, in the same order:
1. **Order.** Dependencies come before the mods that need them, and otherwise mods load alphabetically. Mods that depend
on each other in a circle are an error. The server sends its order to clients, and they follow it.
2. **Data**, one mod at a time: its block models, blocks (and their items), items, entity models, entities and effects.
Then every mod's [tags](../resources/tags.md), merged in load order, then each mod's recipes and ores, which can use
tags.
2. **Data**, one mod at a time: its block models, blocks (and their items), items, entity models, entities, effects and
fluids. Then every mod's [tags](../resources/tags.md), merged in load order, then each mod's recipes and ores, which
can use tags.
3. **Scripts.** Server scripts' `setup` runs on the server, and client scripts' on each client. Worldgen scripts'
`setup` runs on the server before it makes chunks.
+1
View File
@@ -18,6 +18,7 @@ mods/
models/*.geo.json # entity models
entities/*.json
effects/*.json # status effects, see entities/effects.md
fluids/*.json # fluids that can be held, see resources/fluids.md
recipes/*.json
tags/<registry>/<namespace>/*.json # tags, see resources/tags.md
loot_tables/**/*.json # loot tables, see resources/loot_tables.md
+28
View File
@@ -0,0 +1,28 @@
# Fluids
Fluids are what bottles and tanks hold, like juice or oil. They work like NeoForge's `FluidType`s: a fluid is defined
once, apart from any block, container or amount.
This isn't the same as a [block with `fluid`](../blocks/index.md#fluids), like water, which flows in the world. A fluid
here has no block, so it can't be placed.
## Defining a Fluid
`fluids/maple_syrup.json`:
```json
{
"format_version": 1,
"fluid": {
"id": "copper_tools:maple_syrup",
"name": "Maple Syrup",
"color": "#a0522d"
}
}
```
| Field | Required | What it does |
| ------- | -------- | ------------------------------------------------------------------------------------------- |
| `id` | yes | The fluid's id, in the mod's [namespace](../concepts/registries.md#identifiers). |
| `name` | no | What players see. `copper_tools:maple_syrup` is "Maple Syrup" when not set, like an item's. |
| `color` | yes | Its color, like `"#a0522d"`, for whatever shows it. |