Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package boots;
- import org.bukkit.Bukkit;
- import org.bukkit.Color;
- import org.bukkit.Material;
- import org.bukkit.entity.EntityType;
- import org.bukkit.entity.Player;
- import org.bukkit.entity.Villager;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.LeatherArmorMeta;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class BootTrader {
- public BootTrader (Player p) {
- Villager v = (Villager) p.getWorld().spawnEntity(p.getLocation(), EntityType.VILLAGER);
- v.setCustomName("§5§lBoot-Trader");
- v.setCustomNameVisible(true);
- v.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 30000, 30000));
- }
- public static Inventory getBootInv() {
- Inventory inv = Bukkit.createInventory(null, 9*4,"§6§lBoot-Trader");
- inv.addItem(createBoot("§b§lCloud-Boots", Color.AQUA));
- inv.addItem(createBoot("§c§lLove-Boots", Color.RED));
- return inv;
- }
- private static ItemStack createBoot(String name, Color color) {
- ItemStack item = new ItemStack(Material.LEATHER_BOOTS);
- LeatherArmorMeta imeta = (LeatherArmorMeta) item.getItemMeta();
- imeta.setDisplayName(name);
- imeta.setColor(color);
- item.setItemMeta(imeta);
- return item;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment