Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. package com.snooker.SpecialPet;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.Material;
  7. import org.bukkit.inventory.ItemFlag;
  8. import org.bukkit.inventory.ItemStack;
  9. import org.bukkit.inventory.meta.ItemMeta;
  10.  
  11. public class Smith {
  12.  
  13. public ItemStack makeItem(Material m, String name, String desc, int amount ){
  14. ItemStack item = new ItemStack (m, amount);
  15.  
  16. //create the items meta data, name, text etc
  17. ItemMeta im = item.getItemMeta();
  18. im.setDisplayName(name);
  19.  
  20. //Create the lore
  21. ArrayList<String> lore = new ArrayList<String>();
  22. lore.add(desc);
  23. im.setLore(lore);
  24.  
  25. //Hide the vanilla minecraft tooltip text
  26. im.addItemFlags(ItemFlag.HIDE_ENCHANTS);
  27. im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
  28.  
  29. //Set the items meta data to custom 'im' meta data
  30. item.setItemMeta(im);
  31.  
  32. return item;
  33. }
  34.  
  35. public ItemStack speed(int amount) {
  36. Material m = Material.SUGAR;
  37. String name = (ChatColor.RED + "Speed Boost");
  38.  
  39. return makeItem(m, name, name, amount);
  40.  
  41. }
  42.  
  43. public ItemStack absorb(int amount) {
  44. Material m = Material.GOLD_NUGGET;
  45. String name = (ChatColor.RED + "Absorbtion Boost");
  46. String desc = (ChatColor.DARK_GRAY + "Right click to activate");
  47.  
  48. return makeItem(m, name, desc, amount);
  49.  
  50.  
  51. }
  52.  
  53. public ItemStack jump(int amount) {
  54. Material m = Material.EMERALD;
  55. String name = (ChatColor.RED + "Jump Boost");
  56. String desc = (ChatColor.DARK_GRAY + "Right click to activate");
  57.  
  58. return makeItem(m, name, desc, amount);
  59.  
  60.  
  61. }
  62.  
  63.  
  64.  
  65. public ItemStack night(int amount) {
  66. Material m = Material.CARROT;
  67. String name = (ChatColor.RED + "Night Vision Boost");
  68. String desc = (ChatColor.DARK_GRAY + "Right click to activate");
  69.  
  70. return makeItem(m, name, desc, amount);
  71.  
  72. }
  73.  
  74. public ItemStack strength(int amount) {
  75. Material m = Material.REDSTONE;
  76. String name = (ChatColor.RED + "Strength Boost");
  77. String desc = (ChatColor.DARK_GRAY + "Right click to activate");
  78.  
  79. return makeItem(m, name, desc, amount);
  80.  
  81. }
  82.  
  83.  
  84.  
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement