Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-217212

Distribution of iron and coal ores has sharp jumps at particular heights



    • Bug
    • Status: Resolved
    • Resolution: Works As Intended
    • 21w08b
    • None
    • None
    • Plausible
    • World generation


      The bug

      The height generation of iron and coal ores jumps sharply at certain Y levels, due to overlapping of flat and ramped distributions. For coal it is around Y=136 and for iron it is a smaller jump at around Y=-8.

      This is happening for coal and iron because a flat ore distribution overlaps with the tail of a triangular distribution but the flat distribution does not extend over the whole of the triangular distribution. Compare this to the likely correct behaviour of redstone ore above Y=-64 where the flat distribution does not overlap in this way above Y=-64. However, redstone ore may also be affected below Y=-64 if the flat distribution ends before the triangular distribution (I have not tested this because it requires a custom world).

      This is a mathematical problem in the code and it can be fixed with a mathematical solution. Two fixes are possible: (1) Create a "ramp" distribution that behaves like a triangular distribution but only extending in one direction. The ramp can be combined with a flat distribution to create ramps. (2) Amend the triangular distribution to include a maximum value.

      How these fixes would look with a simplified numeric progression. (1) 0, 1, 2, 3, 4, 5, 0. (2, clamped at 4) 0, 1, 2, 3, 4, 4, 4, 4, 4, 3, 2, 1, 0.


        Issue Links



              hkniberg [Mojang] Henrik Kniberg
              bdm68 bdm68
              3 Vote for this issue
              3 Start watching this issue