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:
I think all should work, but...
Please Help me I can't release my mod if my block doesn't drop itself...