🧑🍳Furnace Recipes
Create furnace recipes with ease
Overview
The Furnace
class provides a utility for registering custom furnace recipes in Bukkit.
Constructors
Furnace(Plugin plugin)
Furnace(Plugin plugin)
public Furnace(Plugin plugin)
Creates a new instance of the Furnace
class with the specified plugin.
Parameters
plugin
: The Plugin instance representing the plugin that owns this furnace recipe.
Methods
registerRecipe
registerRecipe
public Furnace registerRecipe(Material input, ItemStack output, String name, List<String> lore, Map<Enchantment, Integer> enchantments)
Registers a custom furnace recipe.
Parameters
input
: The Material representing the input item for the recipe.output
: The ItemStack representing the output item of the recipe.name
: The display name of the output item.lore
: The lore of the output item.enchantments
: A map of enchantments and their levels for the output item.
Returns
Furnace
: The current instance of theFurnace
class.
Usage
Create a new instance of the
Furnace
class with the desired plugin.Use the
registerRecipe
method to register a custom furnace recipe.Provide the input item, output item, name, lore, and enchantments for the recipe.
The recipe will be automatically added to the Bukkit server's recipe list.
Example
Plugin plugin = // your Plugin instance
Furnace furnace = new Furnace(plugin);
Material input = Material.IRON_INGOT;
ItemStack output = new ItemStack(Material.IRON_SWORD);
String name = "Custom Sword";
List<String> lore = Arrays.asList("Custom Lore Line 1", "Custom Lore Line 2");
Map<Enchantment, Integer> enchantments = new HashMap<>();
enchantments.put(Enchantment.DURABILITY, 1);
furnace.registerRecipe(input, output, name, lore, enchantments);
In this example, we register a custom furnace recipe that converts iron ingots into iron swords. The output iron sword has a custom name, lore, and enchantment.
Last updated