Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. public void spawnVillager(Location location) {
  2.  
  3. World w = Bukkit.getWorld("Spawn");
  4.  
  5. final Skeleton s = (Skeleton) Bukkit.getWorld("Spawn").spawn(new Location(w, 115.5, 4, -120.5), Skeleton.class);
  6. s.setCustomName("§bKitPvP");
  7. s.setCustomNameVisible(true);
  8. s.setCanPickupItems(false);
  9. s.setRemoveWhenFarAway(false);
  10. s.getEquipment().setHelmet(new ItemStack(Material.GLASS));
  11. s.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
  12. s.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
  13. s.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
  14. s.getEquipment().setItemInHand(new ItemStack(Material.DIAMOND_SWORD));
  15.  
  16. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
  17.  
  18. public void run() {
  19. s.teleport(new Location(Bukkit.getWorld("Spawn"), 115.5, 4, -120.5));
  20. s.addPotionEffect(new PotionEffect(PotionEffectType.SLOW , 80, 80));
  21. s.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 80, 80));
  22. s.setNoDamageTicks(10000000);
  23.  
  24. }
  25. }, 0, 20);
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement