Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.pogostick29.leatherrecipe;
- import java.util.Arrays;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Color;
- import org.bukkit.Material;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.ShapedRecipe;
- import org.bukkit.inventory.ShapelessRecipe;
- import org.bukkit.inventory.meta.LeatherArmorMeta;
- import org.bukkit.plugin.java.JavaPlugin;
- public class LeatherRecipe extends JavaPlugin {
- public void onEnable() {
- hrecipe();
- precipe();
- }
- private void hrecipe() {
- ItemStack helmet = new ItemStack(Material.LEATHER_HELMET, 1);
- LeatherArmorMeta meta = (LeatherArmorMeta) helmet.getItemMeta();
- meta.setDisplayName(ChatColor.GRAY + "Special Helmet");
- meta.setLore(Arrays.asList("This helmet", "is very special", "Use it wisely."));
- meta.setColor(Color.LIME);
- helmet.setItemMeta(meta);
- ShapedRecipe hrecipe = new ShapedRecipe(helmet);
- hrecipe.shape(
- "@@@",
- "@ @");
- hrecipe.setIngredient('@', Material.IRON_BLOCK);
- Bukkit.getServer().addRecipe(hrecipe);
- }
- private void precipe() {
- ItemStack plate = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
- LeatherArmorMeta meta2 = (LeatherArmorMeta) plate.getItemMeta();
- meta2.setDisplayName(ChatColor.GRAY + "Special Chestplate");
- meta2.setLore(Arrays.asList("This chestplate", "is very special", "Use it wisely."));
- meta2.setColor(Color.AQUA);
- plate.setItemMeta(meta2);
- ShapelessRecipe precipe = new ShapelessRecipe(plate);
- precipe.addIngredient(6, Material.IRON_BLOCK);
- precipe.addIngredient(2, Material.APPLE);
- Bukkit.getServer().addRecipe(precipe);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment