Skip to content

[ Future request ] Better config #2

@JackYevhen

Description

@JackYevhen

The one more thing I'd like to see in mod is: better config & data pack compatibility.
In main game a lot of similar things (form fishing to chest loot) are determined by loot tables.

Example loot table:

{
  "type": "minecraft:command",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "weight": 100,
          "name": "minecraft:diamond_ore",
          "conditions": [
            {
              "condition": "minecraft:location_check",
              "offsetY": 1,
              "predicate": {
                "block": {
                  "blocks": [
                    "minecraft:stone"
                  ]
                }
              }
            }
          ]
        },
        {
          "type": "minecraft:item",
          "weight": 100,
          "name": "minecraft:deepslate_diamond_ore",
          "conditions": [
            {
              "condition": "minecraft:location_check",
              "offsetY": 1,
              "predicate": {
                "block": {
                  "blocks": [
                    "minecraft:deepslate"
                  ]
                }
              }
            }
          ]
        },
        {
          "type": "minecraft:item",
          "weight": 1,
          "name": "minecraft:diorite"
        }
      ],
      "conditions": [
        {
          "condition": "minecraft:location_check",
          "offsetY": -1,
          "predicate": {
            "block": {
              "blocks": [
                "minecraft:diamond_block"
              ]
            }
          }
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "weight": 9,
          "name": "minecraft:netherrack"
        },
        {
          "type": "minecraft:item",
          "weight": 1,
          "name": "minecraft:nether_gold_ore"
        }
      ],
      "conditions": [
        {
          "condition": "minecraft:location_check",
          "offsetY": -1,
          "predicate": {
            "fluid": {
              "fluid": "minecraft:lava"
            }
          }
        }
      ]
    }
  ]
}

What it does:

  • If diamond block is bellow:
    • if deepslate is above: deepslate diamond ore
    • if stone is above: normal diamond ore
    • if not any of those: diorite
  • if lava is bellow:
    • 1 / 10 - nether gold ore
    • 9 / 10 - netherrack

How I'd like to see config for the generator: (does nearly the same loot table above)

[
    {
        "type": "condition",
        "conditions": [{"type": "block", "position": [0, -1, 0], "match": ["minecraft:diamond_block"]}],
        "content": [
            {
                "type": "condition",
                "conditions": [{"type": "block", "position": [0, 1, 0], "match": ["minecraft:stone"]}],
                "content": [
                    {"type": "block", "content": "minecraft:diamond_ore"}
                ]
            },
            {
                "type": "condition",
                "conditions": [{"type": "block", "position": [0, 1, 0], "match": ["minecraft:deepslate"]}],
                "content": [
                    {"type": "block", "content": "minecraft:deepslate_diamond_ore"}
                ]
            },
            {"type": "block", "content": "minecraft:diorite"}
        ]
    },
    {
        "type": "condition",
        "conditions": [{"type": "fluid", "position": [0, -1, 0], "match": ["minecraft:lava"]}],
        "content": [
            {
                "type": "condition",
                "conditions": [{"type": "chance", "content": {"min": 0, "max": 100, "reqiered": 90}}],
                "content": [
                    {"type": "block", "content": "minecraft:netherrack"}
                ]
            },
            {"type": "block", "content": "minecraft:nether_gold_ore"}
        ]
    },
    {"type": "block", "content": "minecraft:stone"}
]

I am ( NOT ) an expert, but I can try to design editor for this (if it will actually will be implemented).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions