Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Surface rule

From SAS Gaming Wiki

Template:Exclusive

Surface rules are used to determine the block for each solid position of the terrain. They are responsible for grass and Minecraft:dirt layers, creating different bands of Minecraft:terracotta in badlands, for Minecraft:deepslate, Minecraft:bedrock, and more.

Surface rules are used in the noise settings of a Minecraft:data pack.

JSON format

A surface rule is a type of decision tree. Using a combination of sequences and conditions, it can implement checks to place the right blocks in the right places.

The possible values for Template:Nbt and associated extra fields:

  • sequence — Tries surface rules in order, only the first that matches is applied.

Surface conditions

The possible values for Template:Nbt and associated extra fields:

  • above_preliminary_surface — Checks if the current position is above the preliminary surface level, which is a Y-level usually a few blocks below the main surface, ignoring noise caves. This is used to prevent grass blocks from being placed in noise caves. This condition has no extra fields. The preliminary surface level is calculated from the Template:Cd noise router density function.
  • hole — Passes for columns where the surface depth is 0. This condition has no extra fields.
  • not — Inverts a surface conditions, passing when the nested condition fails.
  • steep — Checks if the current position is a steep face on the north or east sides of a mountain. This condition has no extra fields.
  • temperature — Checks if the current block is in a biome that is cold enough for Minecraft:snowfall. This condition has no extra fields.
  • water — Checks if the current position is above water, based on terrain depth. Note that if there is no water above this block, the condition always passes, regardless of the values of the fields.
    • Template:Nbt: The value added to the water depth before the comparison is done. This value can be negative to match blocks at a specific depth relative to water surface.
    • Template:Nbt: Value between -20 and 20. How much it is affected by the surface depth. Template:Cd is added to offset before comparing.
    • Template:Nbt: If true, adds the distance to the surface to the offset, effectively checking if the surface block above this one is above water.

Surface depth

The surface depth is an integer value computed for each column, which is used by various conditions. It uses the Template:Cd Minecraft:noise. The calculation is as follows: Template:Cd where Template:Cd returns the noise value of the Template:Cd noise and Template:Cd returns a random value between 0 and 1.

Secondary surface depth

The secondary surface depth is a value between -1 and 1 computed for each column, which can be used by the stone_depth condition. It uses the Template:Cd Minecraft:noise.

Terrain depth

The generator tracks the vertical distance to the surface above (internally stoneDepthAbove) and the cavity below (internally stoneDepthBelow), as well as how deep underwater each block is (if there is any water above it at all; waterHeight). These values are used in the stone_depth, water and y_above conditions.

History

Java Edition

Template:HistoryTable

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Oberflächenregel Minecraft:fr:Règle de surface