Scattered Building Reference¶
TL;DR
scattered/<name>.json describes a standalone structure placed out in the wilderness, entirely outside cities. Cabins, oil rigs and radio towers are the shipped examples. code review
Some keys here do not exist on every version
rotatable, nearhighway, feather, minSpawnDistance and maxSpawnDistance arrived in 7.4.12 and are absent in 8.2.2. allowvoid arrived in 7.4.12 and is present in 8.2.2. supportpart and clearhighwayrailing need 7.5.1. See Key availability. code review
Nothing placed on 6.0.3 or 8.2.2
The settings on this page put one structure in every chunk on 7.4.12. Swept
across 49 chunks they produced no blocks at all on 6.0.3 and none on 8.2.2, with
no error logged either time. Those versions place scattered buildings from
LostCityTerrainFeature rather than the dedicated generator 7.4.12 and later
use, and they have no scatteredChanceMultiplier. Every key used is declared on
both, so this is not a key availability problem. game test code review
Placement is tested, the rest of the keys are not
Scattered structures have been generated on the rig and they appear where the area grid says they should. terrainheight: average and terrainfix: clear are covered by that run. The other terrainheight and terrainfix values, nearhighway, allowvoid and maxheightdiff as a filter are read from the code and have not been run. game test
Keys¶
| Key code review | Required | Meaning |
|---|---|---|
buildings |
one of these two | A list of building names. The mod picks one at random |
multibuilding |
A single multi-building name, used instead of buildings |
|
rotatable |
no | Does nothing in 7.4.12. See the warning below |
terrainheight |
yes | One of lowest, average, highest, ocean. Decides which terrain height the structure is seated at |
terrainfix |
yes | One of none, clear, repeatslice. Decides what the mod does to the terrain around the structure |
heightoffset |
no | A vertical offset in blocks. Defaults to 0 |
rotatable is dropped before generation ever sees it
The key does not reach the asset at all, unlike the inert city style keys which at least reach the city style object and the public API. rotatable parses into the codec record and is never copied into the ScatteredBuilding the generator uses. The asset class has no field for it and no API method exposes it. code review
So "rotatable": true has no effect and no route to one. A scattered structure generates in the orientation you authored. code review
A scattered asset with neither buildings nor multibuilding throws
Both keys are optional in the codec, so a file with neither loads cleanly. The mod then throws Missing buildings for scattered '<name>'! when it tries to place the structure. code review
Where placement is controlled¶
This asset defines the structure and nothing else. Where and how often it spawns lives in a World Style's scattered block, and the per-structure filters live on each entry of its list. code review
| Key code review | Required | Limits | Meaning |
|---|---|---|---|
name |
yes | The scattered asset to place | |
weight |
yes | 0 or more | The weight in the draw, against the other entries and against weightnone |
nearhighway |
no | true places the structure only when one of the four neighbouring chunks has a highway |
|
allowvoid |
no | true allows placement where the terrain is at or near world bottom. Consulted only on the floating, space and spheres landscapes, ignored on default and cavern |
|
maxheightdiff |
no | blocks, 0 or more | Rejects the spot when the highest terrain minus the lowest across the whole footprint exceeds this. The flatness filter |
biomes |
no | A standard Matcher |
The shipped list, which is a good template
[
{ "name": "radiotower", "weight": 15, "maxheightdiff": 3,
"biomes": { "excluding": ["#minecraft:is_ocean", "#minecraft:is_river", "#minecraft:is_beach"] } },
{ "name": "oilrig", "weight": 4, "maxheightdiff": 100,
"biomes": { "if_any": ["#minecraft:is_deep_ocean"] } },
{ "name": "cabin", "weight": 10, "maxheightdiff": 2,
"biomes": { "excluding": ["#minecraft:is_ocean", "#minecraft:is_river", "#minecraft:is_beach"] } }
]
maxheightdiff does most of the work. The cabin needs near-flat ground at 2, the radio tower tolerates a little slope at 3, and the oil rig sits on open water where 100 is effectively unlimited. code review
A multi-building here must fit the scattered areasize
A multibuilding's dimx and dimz must not exceed the world style's scattered.areasize, whose shipped default is 8, or the mod throws during generation. See Multi-Building. code review
Example¶
{
"buildings": ["cabin"],
"terrainheight": "average",
"terrainfix": "clear",
"heightoffset": 0
}
See also¶
- World Style Reference for the settings that place these
- Multi-Building Reference
- Matchers