Custom blocks - AmthystXx/Geode GitHub Wiki

In order to make custom blocks, you need a recipe and a loot table. You also need a custom model for the block.

Template Recipe:

{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [
      {
        "item": "minecraft:barrier"
      }
  ],
  "result": {
    "id": "minecraft:item_frame",
    "count": 1,
    "components": {
      "minecraft:item_name": "{\"text\":\"[Example block name]\"}",
      "minecraft:custom_model_data": [Item custom model data],
      "minecraft:entity_data": {
        "id": "minecraft:item_frame",
        "Tags": ["geode.item_frame_block"],
        "Item": {
          "id":"minecraft:item_frame",
          "components":{
            "minecraft:custom_data": {
              "pack_name":"[Your datapack’s namespace]",
              "block":"[The name of your recipe and loot table]",
              "base_block":"[Base block]",
              "custom_model_data":[Block custom model data],
              "scalex":[Scale on X axis],
              "scaley":[Scale on Y axis],
              "scalez":[Scale on Z axis]
            }
          }
        },
        "Facing": 1,
        "Fixed": true,
        "Invisible": true,
        "Invulnerable": true,
        "Silent": true
      }
    }
  }
}

Template loot table:

{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:item_frame",
          "functions": [ 
            {
              "function": "minecraft:set_components",
              "components": {
                "minecraft:item_name": "{\"text\":\"[Example block name]\"}",
                "minecraft:custom_model_data": [Item custom model data],
                "minecraft:entity_data": {
                  "id": "minecraft:item_frame",
                  "Tags": ["geode.item_frame_block"],
                  "Item": {
                    "id":"minecraft:item_frame",
                    "components": {
                      "minecraft:custom_data": {
                        "pack_name":"[Your datapack’s namespace]",
                        "block":"[The name of your recipe and loot table]",
                        "base_block":"[Base block]",
                        "custom_model_data":[Block custom model data],
                        "scalex":[Scale on X axis],
                        "scaley":[Scale on Y axis],
                        "scalez":[Scale on Z axis]
                      }
                    }
                  },
                  "Facing": 1,
                  "Fixed": true,
                  "Invisible": true,
                  "Invulnerable": true,
                  "Silent": true
                }
              }
            }         
          ]
        }
      ]
    }
  ]
}