Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.MeskeDev.CustomRecipe;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Material;
- import org.bukkit.NamespacedKey;
- import org.bukkit.enchantments.Enchantment;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.ShapedRecipe;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin{
- @Override
- public void onEnable() {
- Bukkit.addRecipe(getPickaxeRecipe());
- Bukkit.addRecipe(getHelmetRecipe());
- Bukkit.addRecipe(getChestplateRecipe());
- Bukkit.addRecipe(getLeggingsRecipe());
- Bukkit.addRecipe(getBootsRecipe());
- }
- @Override
- public void onDisable() {
- }
- public ShapedRecipe getPickaxeRecipe() {
- ItemStack item = new ItemStack(Material.DIAMOND_PICKAXE);
- ItemMeta meta = item.getItemMeta();
- meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Pickaxe");
- meta.addEnchant(Enchantment.LOOT_BONUS_BLOCKS, 4, true);
- meta.addEnchant(Enchantment.DIG_SPEED, 6, true);
- item.setItemMeta(meta);
- NamespacedKey key = new NamespacedKey(this, "Legendary_Pickaxe");
- ShapedRecipe recipe = new ShapedRecipe(key, item);
- recipe.shape("DEI", " S ", " S ");
- recipe.setIngredient('D', Material.DIAMOND_BLOCK);
- recipe.setIngredient('E', Material.EMERALD_BLOCK);
- recipe.setIngredient('I', Material.IRON_BLOCK);
- recipe.setIngredient('S', Material.STRING);
- return recipe;
- }
- public ShapedRecipe getSwordRecipe() {
- ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
- ItemMeta meta = item.getItemMeta();
- meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Sword");
- meta.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
- meta.addEnchant(Enchantment.LOOT_BONUS_MOBS, 4, true);
- item.setItemMeta(meta);
- NamespacedKey key = new NamespacedKey(this, "Legendary_Sword");
- ShapedRecipe recipe = new ShapedRecipe(key, item);
- recipe.shape(" D ", " E ", " S ");
- recipe.setIngredient('D', Material.DIAMOND_BLOCK);
- recipe.setIngredient('E', Material.EMERALD_BLOCK);
- recipe.setIngredient('S', Material.STICK);
- return recipe;
- }
- public ShapedRecipe getHelmetRecipe() {
- ItemStack item = new ItemStack(Material.DIAMOND_HELMET);
- ItemMeta meta = item.getItemMeta();
- meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Helmet");
- meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
- item.setItemMeta(meta);
- NamespacedKey key = new NamespacedKey(this, "Legendary_Helmet");
- ShapedRecipe recipe = new ShapedRecipe(key, item);
- recipe.shape("DDD", "D D", " ");
- recipe.setIngredient('D', Material.DIAMOND_BLOCK);
- return recipe;
- }
- public ShapedRecipe getChestplateRecipe() {
- ItemStack item = new ItemStack(Material.DIAMOND_CHESTPLATE);
- ItemMeta meta = item.getItemMeta();
- meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Chestplate");
- meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
- item.setItemMeta(meta);
- NamespacedKey key = new NamespacedKey(this, "Legendary_Chestplate");
- ShapedRecipe recipe = new ShapedRecipe(key, item);
- recipe.shape("D D", "DDD", "DDD");
- recipe.setIngredient('D', Material.DIAMOND_BLOCK);
- return recipe;
- }
- public ShapedRecipe getLeggingsRecipe() {
- ItemStack item = new ItemStack(Material.DIAMOND_LEGGINGS);
- ItemMeta meta = item.getItemMeta();
- meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Leggings");
- meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
- item.setItemMeta(meta);
- NamespacedKey key = new NamespacedKey(this, "Legendary_Leggings");
- ShapedRecipe recipe = new ShapedRecipe(key, item);
- recipe.shape("DdD", "D D", "D D");
- recipe.setIngredient('D', Material.DIAMOND_BLOCK);
- return recipe;
- }
- public ShapedRecipe getBootsRecipe() {
- ItemStack item = new ItemStack(Material.DIAMOND_BOOTS);
- ItemMeta meta = item.getItemMeta();
- meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Boots");
- meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
- item.setItemMeta(meta);
- NamespacedKey key = new NamespacedKey(this, "Legendary_Boots");
- ShapedRecipe recipe = new ShapedRecipe(key, item);
- recipe.shape(" ", "D D", "D D");
- recipe.setIngredient('D', Material.DIAMOND_BLOCK);
- return recipe;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement