Jump to content

1.17.1 Loot Tables don't work


ZainJx

Recommended Posts

I created my custom Block and I simply want it drops itself, so I just created the Loot Table but it doesn't work.

Here's the Registry code:

public class RegistryHandler {
    // create DeferredRegister object
    public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MossyDeepslate.MOD_ID);
    public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MossyDeepslate.MOD_ID);

    public static final RegistryObject<Block> MOSSY_DEEPSLATE = BLOCKS.register("mossy_deepslate", () ->
            new Block(BlockBehaviour.Properties.of(Material.STONE, MaterialColor.DEEPSLATE).requiresCorrectToolForDrops().strength(0.3F, 0.3f).sound(SoundType.DEEPSLATE)));

    public static final RegistryObject<Item> MOSSY_DEEPSLATE_ITEM = ITEMS.register("mossy_deepslate", () ->
            new BlockItem(MOSSY_DEEPSLATE.get(), new Item.Properties().tab(CreativeModeTab.TAB_BUILDING_BLOCKS))
    );
  
  public static void init() {
        // attach DeferredRegister to the event bus
        BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
        ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
    }
}

The loot table json file:

{
  "type": "minecraft:block",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "mossy_deepslate:mossy_deepslate"
        }
      ]
    }
  ]
}

The folder:

image.png.30a9e1d547f522e54ae9b196ab393e1d.png

I think all should work, but...

Please Help me I can't release my mod if my block doesn't drop itself...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.