public void equipEffectsTask() { RScheduler.schedule(plugin, new Runnable() { public void run() { if (isValid()) { Player p = getPlayer(); EntityEquipment ee = p.getEquipment(); if (ee.getHelmet() != null && ItemManager.isItem(ee.getHelmet(), "miner_helmet")) { if (!equipStates.contains("miner_helmet")) { p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0, true, false), true); equipStates.add("miner_helmet"); } } else { if (equipStates.contains("miner_helmet")) { equipStates.remove("miner_helmet"); p.removePotionEffect(PotionEffectType.NIGHT_VISION); } } RScheduler.schedule(plugin, this, RTicks.seconds(1)); } } }); }
private void giveArmor(LivingEntity entity, PluginConfig worldConfig) { String name = ListUtils.getRandom(worldConfig.getStringList(Config.FEATURE_ZOMBIE_ARMOR_ARMOR)).toUpperCase(); if (Material.getMaterial(name + "_BOOTS") == null) { plugin.getLogger().log(Level.WARNING, "{0} is not a valid armor name", name); return; } EntityEquipment equipment = entity.getEquipment(); equipment.setBoots(new ItemStack(Material.getMaterial(name + "_BOOTS"))); equipment.setLeggings(new ItemStack(Material.getMaterial(name + "_LEGGINGS"))); equipment.setChestplate(new ItemStack(Material.getMaterial(name + "_CHESTPLATE"))); equipment.setHelmet(new ItemStack(Material.getMaterial(name + "_HELMET"))); float dropChance = worldConfig.getInt(Config.FEATURE_ZOMBIE_ARMOR_DROP_CHANCE) / 100.0f; equipment.setBootsDropChance(dropChance); equipment.setLeggingsDropChance(dropChance); equipment.setChestplateDropChance(dropChance); equipment.setHelmetDropChance(dropChance); }
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onStop(BloodMoonEndEvent event) { World world = event.getWorld(); if (plugin.isFeatureEnabled(world, Feature.ZOMBIE_ARMOR)) { for (LivingEntity entity : event.getWorld().getLivingEntities()) { if (entity.getType() == EntityType.ZOMBIE) { EntityEquipment equipment = entity.getEquipment(); equipment.setBoots(null); equipment.setLeggings(null); equipment.setChestplate(null); equipment.setHelmet(null); equipment.setBootsDropChance(0.0f); equipment.setLeggingsDropChance(0.0f); equipment.setChestplateDropChance(0.0f); equipment.setHelmetDropChance(0.0f); } } } }
public void ZombieSpawn(BlockBreakEvent event){ Location loc = event.getBlock().getLocation(); World world = loc.getWorld(); Zombie zombie = (Zombie) world.spawnEntity(loc,EntityType.ZOMBIE); zombie.setCustomName("Bob the Zombie"); zombie.setCustomNameVisible(true); zombie.setMaxHealth(90); zombie.setHealth(90); zombie.setVillager(true); zombie.setTarget(event.getPlayer()); EntityEquipment zombieEquipment = zombie.getEquipment(); zombieEquipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET)); zombieEquipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS)); zombieEquipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE)); zombieEquipment.setBoots(new ItemStack(Material.GOLD_BOOTS)); ItemStack sword = new ItemStack(Material.DIAMOND_SWORD); sword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 4); zombieEquipment.setItemInHand(sword); zombieEquipment.setItemInHandDropChance(0.5F); }
public void storeLiving(final LivingEntity lived) { this.lived = new LivingEntityStats(); this.lived.potions = lived.getActivePotionEffects(); this.lived.loot = lived.getCanPickupItems(); this.lived.name = lived.getCustomName(); this.lived.visible = lived.isCustomNameVisible(); this.lived.health = (float) lived.getHealth(); this.lived.air = (short) lived.getRemainingAir(); this.lived.persistent = lived.getRemoveWhenFarAway(); this.lived.leashed = lived.isLeashed(); if (this.lived.leashed) { final Location loc = lived.getLeashHolder().getLocation(); this.lived.leash_x = (short) (this.x - loc.getBlockX()); this.lived.leash_y = (short) (this.y - loc.getBlockY()); this.lived.leash_z = (short) (this.z - loc.getBlockZ()); } final EntityEquipment equipment = lived.getEquipment(); this.lived.equipped = equipment != null; if (this.lived.equipped) { this.lived.hands = equipment.getItemInHand().clone(); this.lived.boots = equipment.getBoots().clone(); this.lived.leggings = equipment.getLeggings().clone(); this.lived.chestplate = equipment.getChestplate().clone(); this.lived.helmet = equipment.getHelmet().clone(); } }
public static Parameter holdOperation(org.bukkit.entity.LivingEntity le, Context ctx, Parameter set) { EntityEquipment pent = le.getEquipment(); if ( set != null ) { if ( set instanceof ItemParameter) { pent.setItemInHand(((ItemParameter) set).asItemStack(ctx)); } else if ( set instanceof MaterialParameter ) { pent.setItemInHand(new ItemStack(((MaterialParameter) set).asMaterial(ctx), 1)); } else { ItemStack s = Item.createItemstackFromString(set.asString(ctx)); pent.setItemInHand(s); } } return Parameter.from(pent.getItemInHand()); }
public void storeLiving(LivingEntity lived) { this.lived = new LivingEntityStats(); this.lived.potions = lived.getActivePotionEffects(); this.lived.loot = lived.getCanPickupItems(); this.lived.name = lived.getCustomName(); this.lived.visible = lived.isCustomNameVisible(); this.lived.health = (float) lived.getHealth(); this.lived.air = (short) lived.getRemainingAir(); this.lived.persistent = lived.getRemoveWhenFarAway(); this.lived.leashed = lived.isLeashed(); if (this.lived.leashed) { Location location = lived.getLeashHolder().getLocation(); this.lived.leashX = (short) (this.x - location.getBlockX()); this.lived.leashY = (short) (this.y - location.getBlockY()); this.lived.leashZ = (short) (this.z - location.getBlockZ()); } EntityEquipment equipment = lived.getEquipment(); this.lived.equipped = equipment != null; if (this.lived.equipped) { storeEquipment(equipment); } }
@EventHandler public void zombify(PlayerDeathEvent e) { Player p = e.getEntity(); if (!RUtils.isInInfectedWorld(p)) return; if (!Config.spawnZombie) return; Zombie z = ZombieSpawner.spawnLeveledZombie(p.getLocation()); if (z == null) return; EntityEquipment ze = z.getEquipment(); EntityEquipment pe = p.getEquipment(); if (ze == null || pe == null) return; ze.setArmorContents(pe.getArmorContents()); ze.setHelmetDropChance(0F); ze.setChestplateDropChance(0F); ze.setLeggingsDropChance(0F); ze.setBootsDropChance(0F); }
/** * Doesn't seem to work right now but basically, if you smack someone over the head * with the gun instead of shoot it, do less damage. * * @param event The hit event */ @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void weakDamageDirectWithGun(EntityDamageByEntityEvent event) { if (event.getDamager() instanceof LivingEntity) { LivingEntity damager = (LivingEntity) event.getDamager(); EntityEquipment equips = damager.getEquipment(); StandardGun gun = findGun(equips.getItemInMainHand()); if (gun != null) { // modify damage! event.setDamage(gun.getBluntDamage()); } } }
/** * Doesn't seem to work right now but basically, if you smack someone over the head * with the gun instead of shoot it, do less damage. * * @param event The hit event */ @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void weakDamageDirectWithGun(EntityDamageByEntityEvent event) { if (event.getDamager() instanceof LivingEntity) { LivingEntity damager = (LivingEntity) event.getDamager(); EntityEquipment equips = damager.getEquipment(); if (isGun(equips.getItemInMainHand())) { // modify damage! event.setDamage(this.bluntDamage); } } }
@Override protected void onCommand(CommandSender sender, String[] args) { Player player = (Player) sender; EntityEquipment e = player.getEquipment(); ItemStack held = e.getItemInMainHand(); e.setItemInMainHand(e.getHelmet()); e.setHelmet(held); sender.sendMessage(ChatColor.GOLD + "Enjoy your new hat."); }
/** * Gets the inventory with the equipment worn by the living entity. * <p/> * <b>Entities: </b> {@link LivingEntity}, {@link ArmorStand} * * @return the living entity's inventory */ public EntityEquipment getEquipment() { if (entity instanceof LivingEntity) { return ((LivingEntity) entity).getEquipment(); } else if (entity instanceof ArmorStand) { return ((ArmorStand) entity).getEquipment(); } return null; }
@Override @Nullable public Slot convert(final LivingEntity e) { final EntityEquipment eq = e.getEquipment(); if (eq == null) return null; return new EquipmentSlot(eq, slot); }
@SuppressWarnings("deprecation") @Override public void set(final EntityEquipment e, final @Nullable ItemStack item) { if (Skript.isRunningMinecraft(1, 9)) e.setItemInMainHand(item); else e.setItemInHand(item); //Compatibility reasons }
@SuppressWarnings("deprecation") @Override public void set(final EntityEquipment e, final @Nullable ItemStack item) { if (Skript.isRunningMinecraft(1, 9)) e.setItemInOffHand(item); else e.setItemInHand(item); //Compatibility reasons }
public EquipmentConfiguration(EntityEquipment equips) { this.head = equips.getHelmet(); this.chest = equips.getChestplate(); this.legs = equips.getLeggings(); this.boots = equips.getBoots(); this.heldMain = equips.getItemInMainHand(); this.heldOff = equips.getItemInOffHand(); }
private void giveWeapon(LivingEntity entity, PluginConfig worldConfig) { String name = ListUtils.getRandom(worldConfig.getStringList(Config.FEATURE_ZOMBIE_WEAPON_WEAPONS)).toUpperCase(); Material type = Material.getMaterial(name); if (type == null || type.isBlock()) { plugin.getLogger().log(Level.WARNING, "{0} is not a valid item name", name); return; } EntityEquipment equipment = entity.getEquipment(); equipment.setItemInHand(new ItemStack(type)); equipment.setItemInHandDropChance(worldConfig.getInt(Config.FEATURE_ZOMBIE_WEAPON_DROP_CHANCE) / 100.0f); }
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onStop(BloodMoonEndEvent event) { World world = event.getWorld(); if (plugin.isFeatureEnabled(world, Feature.ZOMBIE_WEAPON)) { for (LivingEntity entity : world.getLivingEntities()) { if (entity.getType() == EntityType.ZOMBIE) { EntityEquipment equipment = entity.getEquipment(); equipment.setItemInHand(null); equipment.setItemInHandDropChance(0.0f); } } } }
private void fillInventory(){ menuInv.clear(); EntityEquipment equipment = armorstand.getEquipment(); ItemStack helmet = equipment.getHelmet(); ItemStack chest = equipment.getChestplate(); ItemStack pants = equipment.getLeggings(); ItemStack feetsies = equipment.getBoots(); ItemStack rightHand = equipment.getItemInMainHand(); ItemStack leftHand = equipment.getItemInOffHand(); equipment.clear(); ItemStack disabledIcon = new ItemStack(Material.BARRIER); ItemMeta meta = disabledIcon.getItemMeta(); meta.setDisplayName(pe.plugin.getLang().getMessage("disabled", "warn")); //equipslot.msg <option> ArrayList<String> loreList = new ArrayList<String>(); loreList.add(Util.encodeHiddenLore("ase icon")); meta.setLore(loreList); disabledIcon.setItemMeta(meta); ItemStack helmetIcon = createIcon(Material.LEATHER_HELMET, "helm"); ItemStack chestIcon = createIcon(Material.LEATHER_CHESTPLATE, "chest"); ItemStack pantsIcon = createIcon(Material.LEATHER_LEGGINGS, "pants"); ItemStack feetsiesIcon = createIcon(Material.LEATHER_BOOTS, "boots"); ItemStack rightHandIcon = createIcon(Material.WOOD_SWORD, "rhand"); ItemStack leftHandIcon = createIcon(Material.SHIELD, "lhand"); ItemStack[] items = { helmetIcon, chestIcon, pantsIcon, feetsiesIcon, rightHandIcon, leftHandIcon, disabledIcon, disabledIcon, disabledIcon, helmet, chest, pants, feetsies, rightHand, leftHand, disabledIcon, disabledIcon, disabledIcon }; menuInv.setContents(items); }
private void restoreLiving(final LivingEntity entity) { if (this.lived.loot) { entity.setCanPickupItems(this.lived.loot); } if (this.lived.name != null) { entity.setCustomName(this.lived.name); entity.setCustomNameVisible(this.lived.visible); } if ((this.lived.potions != null) && (this.lived.potions.size() > 0)) { entity.addPotionEffects(this.lived.potions); } entity.setRemainingAir(this.lived.air); entity.setRemoveWhenFarAway(this.lived.persistent); if (this.lived.equipped) { final EntityEquipment equipment = entity.getEquipment(); equipment.setItemInHand(this.lived.hands); equipment.setHelmet(this.lived.helmet); equipment.setChestplate(this.lived.chestplate); equipment.setLeggings(this.lived.leggings); equipment.setBoots(this.lived.boots); } if (this.lived.leashed) { // TODO leashes // World world = entity.getWorld(); // Entity leash = world.spawnEntity(new Location(world, Math.floor(x) + lived.leash_x, Math.floor(y) + lived.leash_y, Math.floor(z) + lived.leash_z), EntityType.LEASH_HITCH); // entity.setLeashHolder(leash); } }
private void createRobot(Skeleton s) { EntityEquipment e = s.getEquipment(); e.setHelmet(new ItemStack(Material.DISPENSER, 1)); e.setChestplate(new ItemStack(Material.IRON_CHESTPLATE, 1)); e.setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS, 1)); e.setLeggings(new ItemStack(Material.IRON_BOOTS, 1)); e.setItemInMainHand(new ItemStack(Material.BOW, 1)); permaVanish(s); }
public DroneShocktroop(Player target){ this.target = target; Location l = getSafeLocationNearTarget(); if(l == null) l = target.getLocation(); mySkeleton = (Skeleton) target.getWorld().spawnEntity(l, EntityType.SKELETON); target.playSound(mySkeleton.getLocation(), Sound.PORTAL_TRAVEL, 2.0F, 2.0F); mySkeleton.setCustomName("Skywatch Shock Trooper"); mySkeleton.setCustomNameVisible(true); EntityEquipment e = mySkeleton.getEquipment(); ItemStack hat = new ItemStack(Material.DISPENSER, 1); ItemStack chest = new ItemStack(Material.DIAMOND_CHESTPLATE, 1); ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS, 1); ItemStack boots = new ItemStack(Material.DIAMOND_BOOTS, 1); chest.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, SQSkywatch.protectionLevel); leggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, SQSkywatch.protectionLevel); boots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, SQSkywatch.protectionLevel); e.setHelmet(hat); e.setChestplate(chest); e.setLeggings(leggings); e.setBoots(boots); ItemStack bow = new ItemStack(Material.BOW, 1); bow.addEnchantment(Enchantment.ARROW_DAMAGE, SQSkywatch.powerLevel); bow.addEnchantment(Enchantment.ARROW_KNOCKBACK, SQSkywatch.knockbackLevel); if(SQSkywatch.flameBows){ bow.addEnchantment(Enchantment.ARROW_FIRE, 1); } e.setItemInHand(bow); mySkeleton.setTarget(target); mySkeleton.getWorld().playEffect(mySkeleton.getLocation(), Effect.ENDER_SIGNAL, 0); }
void restoreEquipment(LivingEntity entity) { EntityEquipment equipment = entity.getEquipment(); if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) { equipment.setItemInMainHand(this.lived.mainHand); equipment.setItemInOffHand(this.lived.offHand); } else { equipment.setItemInHand(this.lived.mainHand); } equipment.setHelmet(this.lived.helmet); equipment.setChestplate(this.lived.chestplate); equipment.setLeggings(this.lived.leggings); equipment.setBoots(this.lived.boots); }
void storeEquipment(EntityEquipment equipment) { if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) { this.lived.mainHand = equipment.getItemInMainHand().clone(); this.lived.offHand = equipment.getItemInOffHand().clone(); } else { this.lived.mainHand = equipment.getItemInHand().clone(); this.lived.offHand = null; } this.lived.boots = equipment.getBoots().clone(); this.lived.leggings = equipment.getLeggings().clone(); this.lived.chestplate = equipment.getChestplate().clone(); this.lived.helmet = equipment.getHelmet().clone(); }
/** * Copies the inventory from the given player to the inventory of this entity. * * @param inPlayer Player to copy inventory from * @param inIgnoreArmor If armor should not be copied or if it should */ public void copyInventory(Player inPlayer, boolean inIgnoreArmor) { this.copyInventory(inPlayer.getInventory()); EntityEquipment equip = this.getBukkitEntity().getEquipment(); if(!inIgnoreArmor) equip.setArmorContents(inPlayer.getInventory().getArmorContents()); if(this.getInventory() instanceof CraftInventoryPlayer) ((CraftInventoryPlayer)this.getInventory()).setHeldItemSlot(inPlayer.getInventory().getHeldItemSlot()); else equip.setItemInHand(inPlayer.getItemInHand()); }
private void giveEquipment(EntityEquipment equipment, GiveKitEvent event) { if (event.getHelmet() != null) equipment.setHelmet(event.getHelmet()); if (event.getChestplate() != null) equipment.setChestplate(event.getChestplate()); if (event.getLeggings() != null) equipment.setLeggings(event.getLeggings()); if (event.getBoots() != null) equipment.setBoots(event.getBoots()); }
@EventHandler public void onEntitySpawn(CreatureSpawnEvent event) { if (event.getEntity() != null) { if (event.getEntity() instanceof Monster) { EntityLevelManager entityLevelManager = plugin.getEntityLevelManager(); int level = entityLevelManager.getEntityLevel(event.getEntity()); if (level == 0) { event.setCancelled(true); } else { EntityEquipment equipment = event.getEntity().getEquipment(); if (level > 5 && level <= 10) { equipment.setHelmet(new ItemStack(Material.LEATHER_HELMET)); equipment.setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE)); equipment.setLeggings(new ItemStack(Material.LEATHER_LEGGINGS)); equipment.setBoots(new ItemStack(Material.LEATHER_BOOTS)); } else if (level > 10 && level <= 15) { equipment.setHelmet(new ItemStack(Material.CHAINMAIL_HELMET)); equipment.setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE)); equipment.setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS)); equipment.setBoots(new ItemStack(Material.CHAINMAIL_BOOTS)); } else if (level > 15 && level <= 20) { equipment.setHelmet(new ItemStack(Material.IRON_HELMET)); equipment.setChestplate(new ItemStack(Material.IRON_CHESTPLATE)); equipment.setLeggings(new ItemStack(Material.IRON_LEGGINGS)); equipment.setBoots(new ItemStack(Material.IRON_BOOTS)); } else if (level > 20 && level <= 25) { equipment.setHelmet(new ItemStack(Material.GOLD_HELMET)); equipment.setChestplate(new ItemStack(Material.GOLD_CHESTPLATE)); equipment.setLeggings(new ItemStack(Material.GOLD_LEGGINGS)); equipment.setBoots(new ItemStack(Material.GOLD_BOOTS)); } else if (level > 25) { equipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET)); equipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE)); equipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS)); equipment.setBoots(new ItemStack(Material.DIAMOND_BOOTS)); } } } } }
public void setHelmet(LivingEntity e) { ItemStack helmet = new ItemStack(Material.LEATHER_HELMET,1); ItemMeta meta = helmet.getItemMeta(); meta.setDisplayName("Christmas Hat"); helmet.setItemMeta(meta); LeatherArmorMeta lmeta = (LeatherArmorMeta) helmet.getItemMeta(); lmeta.setColor(Color.RED); helmet.setItemMeta(lmeta); EntityEquipment ee = e.getEquipment(); ee.setHelmet(helmet); }
public void setChest(LivingEntity e) { ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE,1); ItemMeta meta = chest.getItemMeta(); meta.setDisplayName("Christmas Top"); chest.setItemMeta(meta); LeatherArmorMeta lmeta = (LeatherArmorMeta) chest.getItemMeta(); lmeta.setColor(Color.RED); chest.setItemMeta(lmeta); EntityEquipment ee = e.getEquipment(); ee.setChestplate(chest); }
public void setLegs(LivingEntity e) { ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS,1); ItemMeta meta = leggings.getItemMeta(); meta.setDisplayName("Christmas Pants"); leggings.setItemMeta(meta); LeatherArmorMeta lmeta = (LeatherArmorMeta) leggings.getItemMeta(); lmeta.setColor(Color.WHITE); leggings.setItemMeta(lmeta); EntityEquipment ee = e.getEquipment(); ee.setLeggings(leggings); }
public void setBoots(LivingEntity e) { ItemStack boots = new ItemStack(Material.LEATHER_BOOTS,1); ItemMeta meta = boots.getItemMeta(); meta.setDisplayName("Christmas Boots"); boots.setItemMeta(meta); LeatherArmorMeta lmeta = (LeatherArmorMeta) boots.getItemMeta(); lmeta.setColor(Color.RED); boots.setItemMeta(lmeta); EntityEquipment ee = e.getEquipment(); ee.setBoots(boots); }
public void setHand(LivingEntity e) { ItemStack hand = new ItemStack(Material.CAKE,1); ItemMeta meta = hand.getItemMeta(); meta.setDisplayName("Christmas Pudding"); hand.setItemMeta(meta); EntityEquipment ee = e.getEquipment(); ee.setItemInHand(hand); }
private void removeMapItem(Player player) { EntityEquipment entityEquipment = player.getEquipment(); repairing.remove(player.getName()); if (entityEquipment.getItemInMainHand().hasItemMeta()) { ItemMeta itemMeta = entityEquipment.getItemInMainHand().getItemMeta(); if (itemMeta.hasLore()) { List<String> lore = removeAllString(itemMeta.getLore(), ChatColor.BLACK + "Repairing"); itemMeta.setLore(lore); } entityEquipment.getItemInMainHand().setItemMeta(itemMeta); } }
public EntityEquipment getEquipment() { return inventory; }
public EntityEquipment getEquipment() { return equipment; }
public static PigZombie create(Location l) { PigZombie police = (PigZombie) l.getWorld().spawnEntity(l, EntityType.PIG_ZOMBIE); Pig hov = (Pig) l.getWorld().spawnEntity(l, EntityType.PIG); police.setMaxHealth(80); police.setHealth(80); ItemStack helm = new ItemStack(Material.LEATHER_HELMET); LeatherArmorMeta helmMeta = (LeatherArmorMeta) helm.getItemMeta(); helmMeta.setColor(Color.BLACK); helmMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Helmet"); helmMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true); helm.setItemMeta(helmMeta); ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE); LeatherArmorMeta chestMeta = (LeatherArmorMeta) chest.getItemMeta(); chestMeta.setColor(Color.BLACK); chestMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Vest"); chestMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true); chest.setItemMeta(chestMeta); ItemStack leg = new ItemStack(Material.LEATHER_LEGGINGS); LeatherArmorMeta legMeta = (LeatherArmorMeta) leg.getItemMeta(); legMeta.setColor(Color.BLACK); legMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Leggings"); legMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true); leg.setItemMeta(legMeta); ItemStack boots = new ItemStack(Material.LEATHER_BOOTS); LeatherArmorMeta bootsMeta = (LeatherArmorMeta) boots.getItemMeta(); bootsMeta.setColor(Color.BLACK); bootsMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Boots"); bootsMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true); bootsMeta.addEnchant(Enchantment.PROTECTION_FALL, 15, true); boots.setItemMeta(bootsMeta); EntityEquipment ee = police.getEquipment(); ee.setHelmet(helm); ee.setChestplate(chest); ee.setLeggings(leg); ee.setBoots(boots); ee.setItemInOffHand(new ItemStack(Material.CARROT_STICK)); police.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 1, true, false)); hov.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 4, true, false)); hov.setPassenger(police); police.setCustomName("Officer"); police.setCustomNameVisible(true); police.addScoreboardTag("law"); return police; }
@Override public EntityEquipment getEquipment() { // TODO Auto-generated method stub throw new UnimplementedOperationException(); }
@Override public EntityEquipment getEquipment() { return null; }