Guest User

BootTrader

a guest
Aug 29th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. package boots;
  2.  
  3.  
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.Color;
  7. import org.bukkit.Material;
  8. import org.bukkit.entity.EntityType;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.entity.Villager;
  11. import org.bukkit.inventory.Inventory;
  12. import org.bukkit.inventory.ItemStack;
  13. import org.bukkit.inventory.meta.LeatherArmorMeta;
  14. import org.bukkit.potion.PotionEffect;
  15. import org.bukkit.potion.PotionEffectType;
  16.  
  17. public class BootTrader {
  18. public BootTrader (Player p) {
  19. Villager v = (Villager) p.getWorld().spawnEntity(p.getLocation(), EntityType.VILLAGER);
  20. v.setCustomName("§5§lBoot-Trader");
  21. v.setCustomNameVisible(true);
  22. v.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 30000, 30000));
  23.  
  24. }
  25.  
  26. public static Inventory getBootInv() {
  27. Inventory inv = Bukkit.createInventory(null, 9*4,"§6§lBoot-Trader");
  28. inv.addItem(createBoot("§b§lCloud-Boots", Color.AQUA));
  29. inv.addItem(createBoot("§c§lLove-Boots", Color.RED));
  30.  
  31.  
  32. return inv;
  33. }
  34.  
  35. private static ItemStack createBoot(String name, Color color) {
  36. ItemStack item = new ItemStack(Material.LEATHER_BOOTS);
  37. LeatherArmorMeta imeta = (LeatherArmorMeta) item.getItemMeta();
  38. imeta.setDisplayName(name);
  39. imeta.setColor(color);
  40. item.setItemMeta(imeta);
  41. return item;
  42.  
  43.  
  44.  
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment