Bas Smale

if i put 1 iron ingot and 1 blaze powder in a crafting table i get a netherite ingot and if i put 1 apple and 1 gold nugget i get a golden apple

Kodari AI
KodariSep 1 at 8:39 am 1
CustomCraftingRecipes
CustomCraftingRecipes is a Minecraft plugin that adds custom crafting recipes to the game. Players can combine one iron ingot and one blaze powder in a crafting table to produce a netherite ingot, or combine one apple and one gold nugget to craft a golden apple. The plugin registers these recipes through the Bukkit API, ensuring they appear in the vanilla crafting interface with proper shaped recipe definitions. It provides a lightweight, configuration-free solution for server administrators who want to introduce alternative crafting paths for valuable items, enhancing gameplay progression and resource utilization without modifying the core game files.
  1. Scaffold a Paper plugin with a clean recipe registration entry point.

  2. Add two shapeless crafting recipes with unique namespaced keys and exact one-item outputs.

Created the Paper plugin with:

  • 1 Iron Ingot + 1 Blaze Powder → 1 Netherite Ingot

  • 1 Apple + 1 Gold Nugget → 1 Golden Apple

  • Unique namespaced recipe keys

  • Gradle build configuration and plugin metadata

  • XSeries-based material compatibility

Files created:

  • build.gradle

  • settings.gradle

  • src/main/resources/plugin.yml

  • src/main/java/com/kodari/craftingrecipes/CustomCraftingRecipesPlugin.java

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 78
src/main/java/com/kodari/craftingrecipes/CustomCraftingRecipesPlugin.java
package com.kodari.craftingrecipes;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.plugin.java.JavaPlugin;

public final class CustomCraftingRecipesPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        registerRecipes();
    }

    private void registerRecipes() {
        ShapelessRecipe netheriteRecipe = new ShapelessRecipe(
                new NamespacedKey(this, "iron_and_blaze_to_netherite"),
                item("NETHERITE_INGOT")
        );
        netheriteRecipe.addIngredient(item("IRON_INGOT"));
        netheriteRecipe.addIngredient(item("BLAZE_POWDER"));
        Bukkit.addRecipe(netheriteRecipe);

        ShapelessRecipe goldenAppleRecipe = new ShapelessRecipe(
                new NamespacedKey(this, "apple_and_nugget_to_golden_apple"),
                item("GOLDEN_APPLE")
        );
        goldenAppleRecipe.addIngredient(item("APPLE"));
        goldenAppleRecipe.addIngredient(item("GOLD_NUGGET"));
        Bukkit.addRecipe(goldenAppleRecipe);
    }

    private ItemStack item(String materialName) {
        return XMaterial.matchXMaterial(materialName)
                .map(XMaterial::parseItem)
                .orElseThrow(() -> new IllegalStateException("Required material is unavailable: " + materialName));
    }
}