This commit is contained in:
Prabuddha Hans 2024-07-21 18:57:30 +01:00
parent 1598612b5d
commit 8e8e6cebd3

View file

@ -4,12 +4,14 @@ import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroups;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -19,12 +21,17 @@ public class ExampleMod implements ModInitializer {
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("examplemod");
// Our ingredient item
public static final AdamantiteIngot ADAMANTITE_INGOT = new AdamantiteIngot(new Item.Settings());
@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
// Registering our item
Registry.register(Registries.ITEM, new Identifier("examplemod", "adamantite_ingot"), ADAMANTITE_INGOT);
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(content -> {
content.addAfter(Items.DIAMOND, ADAMANTITE_INGOT);