ulv

Build a plugin that makes brezee rods craftable using lapiz, on the 3x3 table grid , each 9 pieces of lapiz gives u 4 brezee rods

Kodari AI
KodariNov 7 at 2:44 pm 1
BreezeRodCrafting
Adds a custom crafting recipe to Minecraft that allows players to craft breeze rods using lapis lazuli on a standard 3x3 crafting table. The recipe requires 9 pieces of lapis lazuli arranged in a full 3x3 grid, which yields 4 breeze rods as output. The plugin registers the custom recipe on server startup, integrates seamlessly with the vanilla crafting system, and supports all Minecraft versions that include breeze rods. Players can use the recipe in both the crafting table GUI and the player inventory crafting grid. The plugin is lightweight, requires no configuration, and works out of the box with Paper or Spigot servers.
  • Register a 3×3 recipe using nine lapis lazuli.

  • Give four breeze rods per craft when the server supports them.

Added a crafting recipe: fill all nine slots of a crafting table with lapis lazuli to receive four breeze rods.

Kodari can make mistakes. Review important code before using.
Files
src
Code
2 45
src/main/java/com/kodari/breezerods/BreezeRodsPlugin.java
package com.kodari.breezerods;

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

public final class BreezeRodsPlugin extends JavaPlugin {
    private NamespacedKey recipeKey;

    @Override
    public void onEnable() {
        Material lapis = XMaterial.matchXMaterial("LAPIS_LAZULI")
                .map(XMaterial::parseMaterial).orElse(null);
        Material breezeRod = XMaterial.matchXMaterial("BREEZE_ROD")
                .map(XMaterial::parseMaterial).orElse(null);
        if (lapis == null || breezeRod == null) {
            getLogger().warning("Breeze rods or lapis lazuli are not available on this server version; recipe not registered.");
            return;
        }

        recipeKey = new NamespacedKey(this, "breeze_rods");
        ShapedRecipe recipe = new ShapedRecipe(recipeKey, new ItemStack(breezeRod, 4));
        recipe.shape("LLL", "LLL", "LLL");
        recipe.setIngredient('L', lapis);
        if (!Bukkit.addRecipe(recipe)) {
            getLogger().warning("Could not register the breeze rod recipe.");
        }
    }

    @Override
    public void onDisable() {
        if (recipeKey != null) {
            Bukkit.removeRecipe(recipeKey);
        }
    }
}