Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void spawnVillager(Location location) {
- World w = Bukkit.getWorld("Spawn");
- final Skeleton s = (Skeleton) Bukkit.getWorld("Spawn").spawn(new Location(w, 115.5, 4, -120.5), Skeleton.class);
- s.setCustomName("§bKitPvP");
- s.setCustomNameVisible(true);
- s.setCanPickupItems(false);
- s.setRemoveWhenFarAway(false);
- s.getEquipment().setHelmet(new ItemStack(Material.GLASS));
- s.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
- s.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
- s.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
- s.getEquipment().setItemInHand(new ItemStack(Material.DIAMOND_SWORD));
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
- public void run() {
- s.teleport(new Location(Bukkit.getWorld("Spawn"), 115.5, 4, -120.5));
- s.addPotionEffect(new PotionEffect(PotionEffectType.SLOW , 80, 80));
- s.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 80, 80));
- s.setNoDamageTicks(10000000);
- }
- }, 0, 20);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement