Nimu Thebrawlgoat15

make a plugin for 26.3 paper/spigot that when you put a skeleton skull surrounded by 8 coals in a crafting table you get a wither skeleton skull

Kodari AI
KodariFri at 2:17 pm 1
SkeletonSkullConversion
A Minecraft Paper/Spigot plugin for version 1.26.3 that adds a custom crafting recipe. When a player places a skeleton skull in the center of a crafting table surrounded by eight coal items, the recipe outputs a wither skeleton skull. The plugin registers the custom shaped recipe on server startup, ensuring the conversion works seamlessly in both survival and creative modes. It handles recipe registration, prevents conflicts with existing recipes, and provides a lightweight, dependency-free solution for this specific crafting transformation.

I’ll add a shaped recipe that uses one skeleton skull and eight coal to craft a wither skeleton skull.

Created the recipe: surround a skeleton skull with eight coal in a crafting table to make one wither skeleton skull.

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

import com.cryptomorin.xseries.XMaterial;
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 SkullRecipePlugin extends JavaPlugin {
    private NamespacedKey recipeKey;

    @Override
    public void onEnable() {
        Material coal = XMaterial.matchXMaterial("COAL").map(XMaterial::parseMaterial).orElse(null);
        Material skeletonSkull = XMaterial.matchXMaterial("SKELETON_SKULL").map(XMaterial::parseMaterial).orElse(null);
        ItemStack witherSkull = XMaterial.matchXMaterial("WITHER_SKELETON_SKULL").map(XMaterial::parseItem).orElse(null);
        if (coal == null || skeletonSkull == null || witherSkull == null) {
            getLogger().severe("Could not register the skull recipe: required materials are unavailable.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        recipeKey = new NamespacedKey(this, "wither_skeleton_skull");
        ShapedRecipe recipe = new ShapedRecipe(recipeKey, witherSkull);
        recipe.shape("CCC", "CSC", "CCC");
        recipe.setIngredient('C', coal);
        recipe.setIngredient('S', skeletonSkull);
        if (!getServer().addRecipe(recipe)) {
            getLogger().warning("Could not register the wither skeleton skull recipe.");
        }
    }

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