2

I am trying to learn how to use datapacks to affect world generation.

I currently have a datapack with the following files:

\pack.mcmeta:

{
  "pack": {
    "pack_format": 8,
    "description": "Test Data Pack"
  }
}

\data\minecraft\loot_tables\entities\cow.json:

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 0,
                "max": 2,
                "type": "minecraft:uniform"
              }
            },
            {
              "function": "minecraft:looting_enchant",
              "count": {
                "min": 0,
                "max": 1
              }
            }
          ],
          "name": "minecraft:stone"
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1,
                "max": 3,
                "type": "minecraft:uniform"
              }
            },
            {
              "function": "minecraft:furnace_smelt",
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "predicate": {
                    "flags": {
                      "is_on_fire": true
                    }
                  },
                  "entity": "this"
                }
              ]
            },
            {
              "function": "minecraft:looting_enchant",
              "count": {
                "min": 0,
                "max": 1
              }
            }
          ],
          "name": "minecraft:raw_iron"
        }
      ]
    }
  ]
}

This changes what cows drop, in order to make sure the datapack is being loaded in.

\data\test1\structures\structure_test1.nbt:

This is a small structure generated with a structure block.

A file called overworld.json:

{
  "type": "minecraft:overworld",
  "generator": [
    {
      "type": "minecraft:flat"
      "settings": [
        {
          "layers": [
            {
              "height": 24,
              "block": "minecraft:stone"
            },
            {
              "height": 4,
              "block": "minecraft:dirt"
            }]
          "biome": "minecraft:lush_caves"
          "structures": [
            {
              "stronghold": [
                {
                  "distance": 8,
                  "count": 3,
                  "spread": 6
                }]
              "structures": [
                {
                  "test1:structure_test1":[
                    {
                      "spacing": 3,
                      "separation": 1,
                      "salt": 27
                    }]
                }]
            }]
       }]
    }]
}

First, I tried to save overworld.json as \data\minecraft\dimension\overworld.json and run the datapack. My expected result was for me to spawn in a flat world as specified by overworld.json, but my actual result was that I spawned in a default 1.18 world.

I then tried to save overworld.json as \data\test1\dimension\overworld.json and run the datapack, then run /execute in test1:overworld run teleport 0 64 0. My expected result was for me to teleport to the flat world as specified by overworld.json, but my actual result was an error saying the dimension didn't exist.

Unknown dimension test1:overworld

  • Why wasn't my dimension recognised?

  • Is it possible to overwrite the overworld world generation?

I'm aware that there are dimension types that can't be overwritten, but is it possible to overwrite the generation for existing dimensions?

0

You must log in to answer this question.

Browse other questions tagged .