Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void run() {
- for (Player p : Bukkit.getOnlinePlayers()) {
- ItemStack h = p.getInventory().getHelmet();
- ItemStack c = p.getInventory().getChestplate();
- ItemStack l = p.getInventory().getLeggings();
- ItemStack b = p.getInventory().getBoots();
- ItemStack mh = new ItemStack(Material.GOLD_HELMET);
- ItemMeta mhm = mh.getItemMeta();
- mhm.setDisplayName(ChatColor.GOLD + "Mining Helmet");
- ArrayList<String> lo = new ArrayList<String>();
- lo.add(ChatColor.GRAY + "Provides night vision.");
- mhm.setLore(lo);
- mh.setItemMeta(mhm);
- if (h != null && h.equals(mh)){
- p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 40, 0), true);
- p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 120, 0), true);
- }
- if ((h != null && h.getType() == Material.IRON_HELMET) &&
- (c != null && c.getType() == Material.IRON_CHESTPLATE) &&
- (l != null && l.getType() == Material.IRON_LEGGINGS) &&
- (b != null && b.getType() == Material.IRON_BOOTS)) {
- p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 40, 0), true);
- }
- }
- }
- }, 0L, 20L);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement