mojira.dev
MC-308575

The `flower_default` and `flower_warm` features generate a single flower, instead of a flower patch

Due to changes in how flower patches generate in 26.1 Pre-Release 1 (removal of flower, flower_no_bonemeal, and random_patch feature types) flower_default and flower_warm features stopped generating in patches and instead attempt to place either a single poppy or a single dandelion.

Steps to reproduce:

You can reproduce this bug by creating a new world with any seed and looking around for flower patches. Here’s the quick way to get to the flower patch shown on the attached screenshots:

  1. Open two instances of Minecraft - one with the latest version where the bug still applies (26.1.2 or 26.2-pre-3 as of writing this) and another with version 1.21.11.

  2. On both instances create a new world with this seed: -2112823735615928803 and set your gamemode to creative.

  3. On both instances run this command: /execute in minecraft:overworld run tp @s 1374.77 65.37 -2281.68 149.85 42.75

Result:

On the instance with the latest version of Minecraft you can see a single dandelion on the ground. On the instance with version 1.21.11 you can see a patch of poppies and dandelions. 1.21.11 is the intended behavior here.

Possible fixes:

  1. The first fix is to revert the flower patch generation for flower_default and flower_warm to how it was in 1.21.11.
    To do that, add these placement rules to data/minecraft/worldgen/placed_feature/flower_default.json and data/minecraft/worldgen/placed_feature/flower_warm.json:

    {
      "type": "minecraft:count",
      "count": 64
    },
    {
      "type": "minecraft:random_offset",
      "xz_spread": {
          "type": "minecraft:trapezoid",
          "max": 7,
          "min": -7,
          "plateau": 0
        },
      "y_spread": {
          "type": "minecraft:trapezoid",
          "max": 3,
          "min": -3,
          "plateau": 0
        }
    },
    {
      "type": "minecraft:block_predicate_filter",
      "predicate": {
         "type": "minecraft:matching_block_tag",
         "tag": "minecraft:air"
        }
    }
  2. Since MC-238711 is marked as Confirmed, I propose another fix that makes flower_default and flower_warm generate in random patches of a single flower type (poppies or dandelions) instead of patches of both poppies and dandelions in one patch.
    To do that, don’t touch any files under data/minecraft/worldgen/placed_feature/. Instead, replace the code inside data/minecraft/worldgen/configured_feature/flower_default.json with this one:

    {
      "type": "minecraft:random_selector",
      "config": {
        "features": [
          {
            "chance": 0.33333334,
            "feature": {
              "feature": {
                "config": {
                  "to_place": {
                    "type": "minecraft:simple_state_provider",
                    "state": {
                      "Name": "minecraft:dandelion"
                    }
                  }
                },
                "type": "minecraft:simple_block"
              },
              "placement": [
                {
                  "type": "minecraft:count",
                  "count": 64
                },
                {
                  "type": "minecraft:random_offset",
                  "xz_spread": {
                    "type": "minecraft:trapezoid",
                    "max": 7,
                    "min": -7,
                    "plateau": 0
                  },
                  "y_spread": {
                    "type": "minecraft:trapezoid",
                    "max": 3,
                    "min": -3,
                    "plateau": 0
                  }
                },
                {
                  "type": "minecraft:block_predicate_filter",
                  "predicate": {
                    "type": "minecraft:matching_block_tag",
                    "tag": "minecraft:air"
                  }
                }
              ]
            }
          }
        ],
        "default": {
          "feature": {
            "config": {
              "to_place": {
                "type": "minecraft:simple_state_provider",
                "state": {
                  "Name": "minecraft:poppy"
                }
              }
            },
            "type": "minecraft:simple_block"
          },
          "placement": [
            {
              "type": "minecraft:count",
              "count": 64
            },
            {
              "type": "minecraft:random_offset",
              "xz_spread": {
                "type": "minecraft:trapezoid",
                "max": 7,
                "min": -7,
                "plateau": 0
              },
              "y_spread": {
                "type": "minecraft:trapezoid",
                "max": 3,
                "min": -3,
                "plateau": 0
              }
            },
            {
              "type": "minecraft:block_predicate_filter",
              "predicate": {
                "type": "minecraft:matching_block_tag",
                "tag": "minecraft:air"
              }
            }
          ]
        }
      }
    }

I’ve attached Data Packs that apply these fixes, so you can test both of them out.

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media][media][media][media]

jogurciQ

gegy

Confirmed

Platform EC

Important

World generation

26.1.2, 26.2 Pre-Release 3

26.2 Pre-Release 5

Retrieved