Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. package me.MeskeDev.CustomRecipe;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.Material;
  6. import org.bukkit.NamespacedKey;
  7. import org.bukkit.enchantments.Enchantment;
  8. import org.bukkit.inventory.ItemStack;
  9. import org.bukkit.inventory.ShapedRecipe;
  10. import org.bukkit.inventory.meta.ItemMeta;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12.  
  13. public class Main extends JavaPlugin{
  14.  
  15. @Override
  16. public void onEnable() {
  17. Bukkit.addRecipe(getPickaxeRecipe());
  18. Bukkit.addRecipe(getHelmetRecipe());
  19. Bukkit.addRecipe(getChestplateRecipe());
  20. Bukkit.addRecipe(getLeggingsRecipe());
  21. Bukkit.addRecipe(getBootsRecipe());
  22. }
  23. @Override
  24. public void onDisable() {
  25.  
  26. }
  27.  
  28. public ShapedRecipe getPickaxeRecipe() {
  29.  
  30. ItemStack item = new ItemStack(Material.DIAMOND_PICKAXE);
  31. ItemMeta meta = item.getItemMeta();
  32.  
  33. meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Pickaxe");
  34. meta.addEnchant(Enchantment.LOOT_BONUS_BLOCKS, 4, true);
  35. meta.addEnchant(Enchantment.DIG_SPEED, 6, true);
  36.  
  37. item.setItemMeta(meta);
  38.  
  39. NamespacedKey key = new NamespacedKey(this, "Legendary_Pickaxe");
  40.  
  41. ShapedRecipe recipe = new ShapedRecipe(key, item);
  42.  
  43. recipe.shape("DEI", " S ", " S ");
  44.  
  45. recipe.setIngredient('D', Material.DIAMOND_BLOCK);
  46. recipe.setIngredient('E', Material.EMERALD_BLOCK);
  47. recipe.setIngredient('I', Material.IRON_BLOCK);
  48. recipe.setIngredient('S', Material.STRING);
  49. return recipe;
  50. }
  51. public ShapedRecipe getSwordRecipe() {
  52.  
  53. ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
  54. ItemMeta meta = item.getItemMeta();
  55.  
  56. meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Sword");
  57. meta.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
  58. meta.addEnchant(Enchantment.LOOT_BONUS_MOBS, 4, true);
  59.  
  60. item.setItemMeta(meta);
  61.  
  62. NamespacedKey key = new NamespacedKey(this, "Legendary_Sword");
  63.  
  64. ShapedRecipe recipe = new ShapedRecipe(key, item);
  65.  
  66. recipe.shape(" D ", " E ", " S ");
  67.  
  68. recipe.setIngredient('D', Material.DIAMOND_BLOCK);
  69. recipe.setIngredient('E', Material.EMERALD_BLOCK);
  70. recipe.setIngredient('S', Material.STICK);
  71. return recipe;
  72. }
  73.  
  74. public ShapedRecipe getHelmetRecipe() {
  75.  
  76. ItemStack item = new ItemStack(Material.DIAMOND_HELMET);
  77. ItemMeta meta = item.getItemMeta();
  78.  
  79. meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Helmet");
  80. meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
  81.  
  82. item.setItemMeta(meta);
  83.  
  84. NamespacedKey key = new NamespacedKey(this, "Legendary_Helmet");
  85.  
  86. ShapedRecipe recipe = new ShapedRecipe(key, item);
  87.  
  88. recipe.shape("DDD", "D D", " ");
  89.  
  90. recipe.setIngredient('D', Material.DIAMOND_BLOCK);
  91. return recipe;
  92. }
  93.  
  94. public ShapedRecipe getChestplateRecipe() {
  95.  
  96. ItemStack item = new ItemStack(Material.DIAMOND_CHESTPLATE);
  97. ItemMeta meta = item.getItemMeta();
  98.  
  99. meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Chestplate");
  100. meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
  101.  
  102. item.setItemMeta(meta);
  103.  
  104. NamespacedKey key = new NamespacedKey(this, "Legendary_Chestplate");
  105.  
  106. ShapedRecipe recipe = new ShapedRecipe(key, item);
  107.  
  108. recipe.shape("D D", "DDD", "DDD");
  109.  
  110. recipe.setIngredient('D', Material.DIAMOND_BLOCK);
  111. return recipe;
  112. }
  113.  
  114. public ShapedRecipe getLeggingsRecipe() {
  115.  
  116. ItemStack item = new ItemStack(Material.DIAMOND_LEGGINGS);
  117. ItemMeta meta = item.getItemMeta();
  118.  
  119. meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Leggings");
  120. meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
  121.  
  122. item.setItemMeta(meta);
  123.  
  124. NamespacedKey key = new NamespacedKey(this, "Legendary_Leggings");
  125.  
  126. ShapedRecipe recipe = new ShapedRecipe(key, item);
  127.  
  128. recipe.shape("DdD", "D D", "D D");
  129.  
  130. recipe.setIngredient('D', Material.DIAMOND_BLOCK);
  131. return recipe;
  132. }
  133.  
  134. public ShapedRecipe getBootsRecipe() {
  135.  
  136. ItemStack item = new ItemStack(Material.DIAMOND_BOOTS);
  137. ItemMeta meta = item.getItemMeta();
  138.  
  139. meta.setDisplayName(ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "Legendary Boots");
  140. meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
  141.  
  142. item.setItemMeta(meta);
  143.  
  144. NamespacedKey key = new NamespacedKey(this, "Legendary_Boots");
  145.  
  146. ShapedRecipe recipe = new ShapedRecipe(key, item);
  147.  
  148. recipe.shape(" ", "D D", "D D");
  149.  
  150. recipe.setIngredient('D', Material.DIAMOND_BLOCK);
  151. return recipe;
  152. }
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement