Setup

Setting Up Loot Tables:

To define the drops for a specific block, you need to create loot table files. Here's an example of setting up a loot table for the "coreextensions:test_block123" block:

  1. Create the directory:

Create the following directory structure under your namespace:

data\命名空间\loot_tables\blocks

For example, if your namespace is "coreextensions", create the directory:

data\coreextensions\loot_tables\blocks
  1. Create the loot table file:

Create a file named "test_block123.json" in the directory you just created:

data\coreextensions\loot_tables\blocks\test_block123.json
  1. Open the "test_block123.json" file and configure it as follows:

{
  "type": "minecraft:block",
  "pools": [
    {
      "rolls": 1,
      "bonus_rolls": 0,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "coreextensions:test_block123"
        }
      ],
      "conditions": [
        {
          "condition": "minecraft:survives_explosion"
        }
      ]
    }
  ],
  "random_sequence": "coreextensions:test_block123"
}

Make sure to replace "coreextensions:test_block123" with the correct block ID that you want to set up the loot table for.

This setup defines that the "coreextensions:test_block123" block will drop itself when broken, and it specifies the conditions for the drops.

You can use the same tutorial to set up loot tables for other blocks. Just replace "coreextensions:test_block123" with the desired block ID in the loot table file.

Last updated