Карим Шириязданов

Create a Minecraft mod that adds a realistic weapon system with guns, ammunition, grenades, armor, and bombs. Include a dedicated crafting station (weapon workbench) where players can craft firearms, load magazines with bullets, assemble grenades and bombs, and craft different armor tiers. Add multiple weapon types (pistols, rifles, shotguns), each with unique stats like damage, fire rate, and reload time. Grenades and bombs should have different blast radii and effects. Armor should come in tiers with varying protection levels and special perks. The workbench needs a custom UI with slots for components (barrel, stock, magazine, etc.) to allow modular weapon building. Keep the visual style consistent with Minecraft’s blocky aesthetic, but add detailed textures for weapons and ammo. Balance the mod so it fits well in survival gameplay without breaking the core mechanics.

Kodari AI
KodariWed at 9:16 am 20
ModularCombatArsenal
A Fabric mod for Minecraft 1.20.4 introducing a realistic weapon system with modular firearms, ammunition, grenades, bombs, and tiered armor. Players use a custom weapon workbench UI to craft guns from components like barrels, stocks, and magazines, load bullets into magazines, and assemble explosives. Features pistols, rifles, and shotguns with distinct damage, fire rate, and reload stats, plus grenades and bombs with varying blast radii and effects. Armor tiers offer unique protection perks. All textures maintain Minecraft's blocky aesthetic while adding detailed weapon and ammo visuals, balanced for survival gameplay.
  • Build a survival-obtainable foundation with three firearms, ammunition, and a weapon workbench.

  • The full modular interface, explosives, and armor tiers require additional implementation beyond this foundation.

Added a survival foundation: a pistol, rifle, shotgun, ammunition, and a weapon workbench. Craft them from iron, sticks, gunpowder, and crafting tables; their recipes appear in the recipe book.

Still missing: modular component slots, magazines and reload times, grenades, bombs, and armor tiers. The workbench currently uses the standard crafting interface, and its recipes also work at a regular crafting table.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
25 187
src/main/resources/java/com/fieldarms/FieldArms.java
package com.fieldarms;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;

public class FieldArms implements ModInitializer {
    public static final Block WORKBENCH = new WeaponWorkbenchBlock(AbstractBlock.Settings.copy(Blocks.CRAFTING_TABLE));
    public static final Item AMMUNITION = new Item(new Item.Settings());
    public static final Item PISTOL = new GunItem(new Item.Settings().maxDamage(192), 6.0f, 12, 32.0);
    public static final Item RIFLE = new GunItem(new Item.Settings().maxDamage(320), 8.0f, 8, 48.0);
    public static final Item SHOTGUN = new GunItem(new Item.Settings().maxDamage(256), 10.0f, 24, 16.0);

    private static Identifier id(String path) { return new Identifier("fieldarms", path); }

    @Override
    public void onInitialize() {
        Registry.register(Registries.BLOCK, id("weapon_workbench"), WORKBENCH);
        Registry.register(Registries.ITEM, id("weapon_workbench"), new BlockItem(WORKBENCH, new Item.Settings()));
        Registry.register(Registries.ITEM, id("ammunition"), AMMUNITION);
        Registry.register(Registries.ITEM, id("pistol"), PISTOL);
        Registry.register(Registries.ITEM, id("rifle"), RIFLE);
        Registry.register(Registries.ITEM, id("shotgun"), SHOTGUN);
        ItemGroupEvents.modifyEntriesEvent(RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier("minecraft", "combat")))
            .register(entries -> entries.addAfter(Items.CROSSBOW, PISTOL, RIFLE, SHOTGUN, AMMUNITION));
        ItemGroupEvents.modifyEntriesEvent(RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier("minecraft", "functional_blocks")))
            .register(entries -> entries.addAfter(Items.CRAFTING_TABLE, WORKBENCH));
    }
}