Files
src
build.gradle
gradle.properties
settings.gradle
Code
43 490
src/main/java/com/kodari/steelgear/SteelGear.java
package com.kodari.steelgear;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.creativetab.v1.CreativeModeTabEvents;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.CreativeModeTab;
public class SteelGear implements ModInitializer {
public static final String MOD_ID = "steelgear";
@Override
public void onInitialize() {
SteelGearItems.initialize();
ResourceKey<CreativeModeTab> toolsTab = ResourceKey.create(
Registries.CREATIVE_MODE_TAB,
Identifier.fromNamespaceAndPath("minecraft", "tools_and_utilities")
);
CreativeModeTabEvents.modifyOutputEvent(toolsTab).register(output -> {
output.prepend(SteelGearItems.STEEL_INGOT);
output.prepend(SteelGearItems.STEEL_PICKAXE);
output.prepend(SteelGearItems.STEEL_AXE);
output.prepend(SteelGearItems.STEEL_SHOVEL);
output.prepend(SteelGearItems.STEEL_HOE);
});
ResourceKey<CreativeModeTab> combatTab = ResourceKey.create(
Registries.CREATIVE_MODE_TAB,
Identifier.fromNamespaceAndPath("minecraft", "combat")
);
CreativeModeTabEvents.modifyOutputEvent(combatTab).register(output -> {
output.prepend(SteelGearItems.STEEL_SWORD);
output.prepend(SteelGearItems.STEEL_HELMET);
output.prepend(SteelGearItems.STEEL_CHESTPLATE);
output.prepend(SteelGearItems.STEEL_LEGGINGS);
output.prepend(SteelGearItems.STEEL_BOOTS);
});
}
}