Suryanshu Mishra

I want to make a mod which adds a jcb pickaxe, and ultimate miner armour

Kodari AI
KodariNov 3 at 5:30 pm 3
JCBMinerArmor
A Minecraft Fabric mod that introduces a JCB-themed pickaxe with enhanced mining capabilities and an ultimate miner armor set. The JCB pickaxe features increased mining speed, higher durability, and the ability to mine multiple blocks in a single swing. The ultimate miner armor provides exceptional protection, mining fatigue resistance, and passive haste effects while worn. The mod includes custom crafting recipes, unique textures, and balanced progression to integrate seamlessly with vanilla gameplay.

What abilities should the JCB pickaxe and Ultimate Miner armour have? For example, should the pickaxe mine a 3×3 area, and should the full armour set grant Haste or night vision?

Suryanshu Mishra

Suryanshu Mishra the pickaxe should be able to instantly mine any block, smelt any ore (from any mod as well by using a command /jcb add <block>, should have fortune 100 , and should be unbreakable. On breaking bedrock it should be able to regenerate the bedrock and give you one bedrock per mine. The Ultimate Miner Armour should also be unbreakable and give the player every positive effect (level 10) as long as the player wears it. The player should not take any fall damage while wearing the armour. To make the pickaxe and armour add a new material called unbreakerite, To craft it we need every type of ore material (all smelted to their pure form by furnace) (the ores being coal, copper, iron, redstone, gold, diamond, netherite, nether quartz and amethyst), in any order placed in the crafting table. Also the crafting recipes of the pickaxe and armour is the same as that of normal pickaxe and armour (just made with using unbreakerite). Also please give a cool JCB themed 3D texture and shape for the pichaxe and the full set of Ultimate Miner armour.

Kodari AI
KodariNov 3 at 5:53 pm 2

The unbreakerite recipe lists 10 ingredients, but a crafting table has only 9 slots. Which ingredient should be removed, or would you prefer a two-step recipe?

Also, netherite isn’t normally smelted directly into an ingot: should the recipe use a netherite ingot, crafted from netherite scrap and gold?

Suryanshu Mishra

nether quartz is one item itself, that is quartz's actual name, and also since this unbreakerite is to make a really powerful pickaxe and armour it should contain one netherite ingot and not just nether scrap. Also the armour should save you from knockback and magic damages as well as the regular ones

Kodari AI
KodariNov 3 at 6:00 pm 9
  1. Add unbreakerite and survival crafting recipes for the pickaxe and armour.

  2. Implement instant mining, ore smelting, configurable blocks, and regenerating bedrock.

  3. Add the armour’s effects and damage protection, plus JCB-themed visuals.

The nine ingredients fit in one crafting table, including a netherite ingot—I miscounted earlier.

I created the pickaxe model, armour textures, and unbreakerite texture, but the playable mod is not yet implemented. The mining, smelting, command, armour protections, and survival recipes still need code and integration.

Suryanshu Mishra

also give the pickaxe fortune 100

Kodari AI
KodariNov 3 at 6:00 pm 1

The JCB pickaxe will have Fortune 100. It’s included in the design, but the pickaxe and its abilities haven’t been implemented yet.

Suryanshu Mishra

why is it showing missing required files for the fabric mod. What are the missing files. If you can add them, please do or tell me where to add them.

Kodari AI
KodariNov 3 at 6:06 pm 1
  • Add the missing Fabric metadata and Gradle configuration.

  • Keep the existing assets; gameplay code will still need to be implemented.

Added the missing Fabric metadata and Gradle configuration: fabric.mod.json, build.gradle, settings.gradle, and gradle.properties.

The project previously contained only artwork, not a Fabric mod structure. The gameplay code and recipes are still missing, so the pickaxe, armour, and unbreakerite are not yet obtainable or functional. I haven’t verified a build.

Suryanshu Mishra

so what arewe supposed to do?

Kodari AI
KodariNov 3 at 6:08 pm 1

The next step is to implement the mod itself: register unbreakerite, the pickaxe and armour; add their crafting recipes and visuals; then code the mining, smelting, Fortune 100, bedrock regeneration and armour abilities.

After that, use Compile in Kodari to build and download the jar. The artwork and Fabric configuration are in place, but they don’t yet make the items playable.

Suryanshu Mishra

how to do that

Kodari AI
KodariNov 3 at 6:08 pm 1

I can write and integrate the code for you—you don’t need to add it by hand. Once it’s implemented:

  1. Click Compile in the top bar.

  2. Click Compile in the window that opens.

  3. When it succeeds, click Download on the build.

The mod still needs its gameplay code and recipes before it’s ready to play. Want me to implement them now?

Suryanshu Mishra

yes

Kodari AI
KodariNov 3 at 6:11 pm 3
  1. Implement unbreakerite and its crafting recipes.

  2. Implement the JCB pickaxe and its mining abilities.

  3. Implement Ultimate Miner armour and its protections.

  4. Connect the artwork and item visuals.

Unbreakerite is registered with a shapeless recipe using the nine materials, including a netherite ingot.I’ve started the implementation: unbreakerite is registered and can be crafted shapelessly from coal, copper ingot, iron ingot, redstone, gold ingot, diamond, netherite ingot, quartz and an amethyst shard.

The pickaxe, armour, their recipes and abilities are still missing. In particular, instant bedrock mining and modded-ore smelting need additional implementation; they aren’t playable yet. The new material hasn’t been build-verified.

Suryanshu Mishra

okay. pls implement the rest

Kodari AI
KodariNov 3 at 6:16 pm 9
  1. Implement the pickaxe, its recipe, mining abilities and /jcb add.

  2. Implement the armour, its recipes and protections.

  3. Connect the existing artwork and item visuals.

Added a craftable JCB pickaxe with an unbreakable component, Fortune 100 and very fast mining. Craft it with three unbreakerite across the top and two sticks down the middle, like a normal pickaxe.

It isn’t finished yet: bedrock regeneration, ore smelting, /jcb add, the armour and its protections still need implementation. The pickaxe currently uses a 2D texture, not the existing 3D model. I haven’t verified a build.

Suryanshu Mishra

please do verify the build and finish the remaining features

Kodari AI
KodariNov 3 at 6:33 pm 15
  1. Finish and verify the pickaxe’s mining and smelting behavior.

  2. Add the armour, recipes and protections.

  3. Connect the visuals and check the build.

The existing pickaxe’s high mining speed does not bypass bedrock’s unbreakable hardness. That needs a separate mining hook; I’m adding the armour separately rather than treating it as already working.

Added the Ultimate Miner armour with standard armour-shaped recipes using unbreakerite. The full set is configured to grant beneficial effects at level 10 and prevent damage, including fall and magic damage.

The mod is still incomplete: bedrock mining and regeneration, automatic smelting, /jcb add, and the 3D pickaxe integration remain unfinished. I also couldn’t verify the build here, so the armour changes may need fixes after compilation.

To check the build, click Compile in Kodari’s top bar, then Compile in the window. If it fails, click Auto-fix or Fix.

Suryanshu Mishra

it shows success. so just keep going and make this mod completely. You can do it

Kodari AI
KodariNov 3 at 6:52 pm 7
  1. Finish the pickaxe’s bedrock mining, regeneration and automatic smelting.

  2. Add /jcb add for configurable blocks.

  3. Connect the 3D pickaxe model and check for remaining gaps.

Added automatic smelting for ore drops mined with the JCB pickaxe. It uses available smelting recipes and preserves Fortune-adjusted quantities, including for ores from other mods that use the common ore tag.

The mod is not complete yet, and I haven’t verified this latest change with a build. Bedrock mining and regeneration, /jcb add, and the 3D pickaxe visual remain unfinished.

For the remaining behavior, how long should bedrock take to regenerate, and should /jcb add add blocks to the instant-mining list or the automatic-smelting list?

Suryanshu Mishra

while making mod please make sure the person in armour does not fly up. Also pls add recipes and use the 3d pickaxe model that you made. The bedrock should regenerate immediately. We should get the broken bedrock. The command /jcb add should add blocks to both instant-mining and automatic-smelting lists. Also pls add the crafting recipes.

Kodari AI
KodariNov 5 at 1:11 pm 7
  1. Fix the armour effects so they don’t make the wearer rise.

  2. Add immediate bedrock regeneration and drops, plus /jcb add for both mining and smelting.

  3. Connect the 3D pickaxe model and complete the crafting recipes.

The armour no longer grants level-10 Jump Boost, which was making jumps exceptionally high. The JCB changes and recipes are in place; I’m connecting the exported model now.

Implemented the remaining features:

  • Removed the armour’s level-10 Jump Boost, which caused extremely high jumps.

  • Added instant JCB mining and immediate bedrock restoration with a bedrock drop.

  • Added /jcb add <block> for operators. Added blocks are saved per world and included in automatic smelting when their drops have a smelting recipe. The pickaxe already instant-mines all blocks.

  • Connected the exported 3D pickaxe model.

  • Confirmed recipes exist for unbreakerite, the pickaxe and all four armour pieces. Craft the equipment in the usual pickaxe and armour shapes using unbreakerite.

These latest changes haven’t been build- or in-game verified. Please click Compile again; if it fails, use Auto-fix. The previous successful build was before these changes.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
40 8,787
src/main/java/com/kodari/unbreakerite/UnbreakeriteMod.java
package com.kodari.unbreakerite;

import com.geckolib.animatable.GeoItem;
import com.geckolib.animatable.client.GeoRenderProvider;
import com.geckolib.animatable.instance.AnimatableInstanceCache;
import com.geckolib.animatable.manager.AnimatableManager;
import com.geckolib.model.DefaultedItemGeoModel;
import com.geckolib.renderer.GeoItemRenderer;
import com.geckolib.renderer.base.GeoRenderState;
import com.geckolib.util.GeckoLibUtil;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.creativetab.v1.CreativeModeTabEvents;
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
import net.minecraft.commands.Commands;
import net.minecraft.commands.arguments.blocks.BlockStateArgument;
import net.minecraft.core.Registry;
import net.minecraft.core.component.DataComponents;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.network.chat.Component;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Unit;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.item.crafting.SingleRecipeInput;
import net.minecraft.world.item.component.Tool;
import net.minecraft.world.item.equipment.ArmorMaterial;
import net.minecraft.world.item.equipment.ArmorMaterials;
import net.minecraft.world.item.equipment.ArmorType;
import net.minecraft.world.item.equipment.EquipmentAssets;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.item.enchantment.ItemEnchantments;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.level.storage.LevelResource;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;

public class UnbreakeriteMod implements ModInitializer {
    private static final Set<String> JCB_BLOCKS = new HashSet<>();
    public static final ResourceKey<Item> UNBREAKERITE_KEY = ResourceKey.create(
            Registries.ITEM, Identifier.fromNamespaceAndPath("unbreakerite", "unbreakerite"));
    public static final Item UNBREAKERITE = Registry.register(BuiltInRegistries.ITEM, UNBREAKERITE_KEY,
            new Item(new Item.Properties().setId(UNBREAKERITE_KEY)));
    public static final ResourceKey<Item> JCB_PICKAXE_KEY = ResourceKey.create(
            Registries.ITEM, Identifier.fromNamespaceAndPath("unbreakerite", "jcb_pickaxe"));
    public static final Item JCB_PICKAXE = Registry.register(BuiltInRegistries.ITEM, JCB_PICKAXE_KEY,
            new JcbPickaxe(new Item.Properties().setId(JCB_PICKAXE_KEY).stacksTo(1)
                    .component(DataComponents.UNBREAKABLE, Unit.INSTANCE)
                    .component(DataComponents.TOOL, new Tool(List.of(), 100000000.0F, 0, true))
                    .delayedComponent(DataComponents.ENCHANTMENTS, context -> {
                        ItemEnchantments.Mutable enchantments = new ItemEnchantments.Mutable(ItemEnchantments.EMPTY);
                        enchantments.set(context.getOrThrow(Enchantments.FORTUNE), 100);
                        return enchantments.toImmutable();
                    })));

    private static final ArmorMaterial ULTIMATE_MATERIAL = new ArmorMaterial(
            ArmorMaterials.NETHERITE.durability(), ArmorMaterials.NETHERITE.defense(),
            ArmorMaterials.NETHERITE.enchantmentValue(), ArmorMaterials.NETHERITE.equipSound(),
            ArmorMaterials.NETHERITE.toughness(), 1.0F, ArmorMaterials.NETHERITE.repairIngredient(),
            ResourceKey.create(EquipmentAssets.ROOT_ID, Identifier.fromNamespaceAndPath("unbreakerite", "ultimate_miner")));
    public static final Item HELMET = registerArmor("ultimate_miner_helmet", ArmorType.HELMET);
    public static final Item CHESTPLATE = registerArmor("ultimate_miner_chestplate", ArmorType.CHESTPLATE);
    public static final Item LEGGINGS = registerArmor("ultimate_miner_leggings", ArmorType.LEGGINGS);
    public static final Item BOOTS = registerArmor("ultimate_miner_boots", ArmorType.BOOTS);

    private static Item registerArmor(String name, ArmorType type) {
        ResourceKey<Item> key = ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath("unbreakerite", name));
        return Registry.register(BuiltInRegistries.ITEM, key, new Item(new Item.Properties().setId(key)
                .humanoidArmor(ULTIMATE_MATERIAL, type).component(DataComponents.UNBREAKABLE, Unit.INSTANCE)));
    }

    private static boolean wearsFullSet(LivingEntity player) {
        return player.getItemBySlot(ArmorType.HELMET.getSlot()).getItem() == HELMET
                && player.getItemBySlot(ArmorType.CHESTPLATE.getSlot()).getItem() == CHESTPLATE
                && player.getItemBySlot(ArmorType.LEGGINGS.getSlot()).getItem() == LEGGINGS
                && player.getItemBySlot(ArmorType.BOOTS.getSlot()).getItem() == BOOTS;
    }

    @Override
    public void onInitialize() {
        ServerLifecycleEvents.SERVER_STARTED.register(server -> {
            JCB_BLOCKS.clear();
            Path path = server.getWorldPath(LevelResource.DATA).resolve("unbreakerite_jcb_blocks.txt");
            if (Files.exists(path)) {
                try {
                    JCB_BLOCKS.addAll(Files.readAllLines(path));
                } catch (IOException exception) {
                    throw new IllegalStateException("Could not read JCB block list", exception);
                }
            }
        });
        CommandRegistrationCallback.EVENT.register((dispatcher, buildContext, selection) ->
                dispatcher.register(Commands.literal("jcb")
                        .requires(Commands.hasPermission(Commands.LEVEL_ADMINS))
                        .then(Commands.literal("add")
                                .then(Commands.argument("block", BlockStateArgument.block(buildContext))
                                        .executes(context -> {
                                            var block = BlockStateArgument.getBlock(context, "block").getState().getBlock();
                                            String id = BuiltInRegistries.BLOCK.getKey(block).toString();
                                            Set<String> updated = new HashSet<>(JCB_BLOCKS);
                                            updated.add(id);
                                            Path path = context.getSource().getServer().getWorldPath(LevelResource.DATA)
                                                    .resolve("unbreakerite_jcb_blocks.txt");
                                            try {
                                                Files.createDirectories(path.getParent());
                                                Files.write(path, updated.stream().sorted().toList());
                                            } catch (IOException exception) {
                                                context.getSource().sendFailure(Component.literal("Could not save the JCB block list: " + exception.getMessage()));
                                                return 0;
                                            }
                                            JCB_BLOCKS.add(id);
                                            context.getSource().sendSuccess(() -> Component.literal("Added " + id + " to JCB instant mining and automatic smelting."), true);
                                            return 1;
                                        }))));
        LootTableEvents.MODIFY_DROPS.register((table, context, drops) -> {
            var tool = context.getOptional(LootContextParams.TOOL);
            var state = context.getOptional(LootContextParams.BLOCK_STATE);
            var ores = TagKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath("c", "ores"));
            if (tool == null || !tool.is(JCB_PICKAXE) || state == null
                    || (!state.is(ores, block -> true) && !JCB_BLOCKS.contains(BuiltInRegistries.BLOCK.getKey(state.getBlock()).toString()))) {
                return;
            }
            var level = context.getLevel();
            var converted = new ArrayList<ItemStack>();
            for (var drop : drops) {
                var input = new SingleRecipeInput(drop.copyWithCount(1));
                var recipe = level.getServer().getRecipeManager().getRecipeFor(RecipeType.SMELTING, input, level);
                if (recipe.isEmpty()) {
                    converted.add(drop);
                    continue;
                }
                var result = recipe.get().value().assemble(input);
                if (result.isEmpty()) {
                    converted.add(drop);
                    continue;
                }
                int remaining = result.getCount() * drop.getCount();
                while (remaining > 0) {
                    int count = Math.min(remaining, result.getMaxStackSize());
                    converted.add(result.copyWithCount(count));
                    remaining -= count;
                }
            }
            drops.clear();
            drops.addAll(converted);
        });
        CreativeModeTabEvents.modifyOutputEvent(ResourceKey.create(Registries.CREATIVE_MODE_TAB,
                Identifier.fromNamespaceAndPath("minecraft", "ingredients")))
                .register(output -> output.accept(UNBREAKERITE));
        CreativeModeTabEvents.modifyOutputEvent(ResourceKey.create(Registries.CREATIVE_MODE_TAB,
                Identifier.fromNamespaceAndPath("minecraft", "tools_and_utilities")))
                .register(output -> output.accept(JCB_PICKAXE));
        CreativeModeTabEvents.modifyOutputEvent(ResourceKey.create(Registries.CREATIVE_MODE_TAB,
                Identifier.fromNamespaceAndPath("minecraft", "combat")))
                .register(output -> {
                    output.accept(HELMET);
                    output.accept(CHESTPLATE);
                    output.accept(LEGGINGS);
                    output.accept(BOOTS);
                });
        ServerTickEvents.END_SERVER_TICK.register(server -> {
            for (var player : server.getPlayerList().getPlayers()) {
                if (wearsFullSet(player)) {
                    BuiltInRegistries.MOB_EFFECT.listElements()
                            .filter(effect -> effect.value().getCategory() == MobEffectCategory.BENEFICIAL)
                            .filter(effect -> !effect.equals(MobEffects.JUMP_BOOST))
                            .forEach(effect -> player.addEffect(new MobEffectInstance(effect, 40, 9)));
                }
            }
        });
        ServerLivingEntityEvents.ALLOW_DAMAGE.register((entity, source, amount) ->
                !(entity instanceof Player && wearsFullSet(entity)));
    }

    private static class JcbPickaxe extends Item implements GeoItem {
        private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);

        private JcbPickaxe(Properties properties) {
            super(properties);
        }