Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. package me.company;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.Location;
  5. import org.bukkit.World;
  6. import org.bukkit.entity.Cow;
  7. import org.bukkit.entity.EntityType;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. public class Glowna extends JavaPlugin {
  11. @Override
  12. public void onEnable() {
  13. GlownaDwa mob1 = new GlownaDwa(-183, 44, -120, EntityType.COW);
  14. try {
  15. mob1.spawnMob();
  16. } catch (InterruptedException e) {
  17. e.printStackTrace();
  18. }
  19. }
  20. @Override
  21. public void onDisable(){
  22.  
  23. }
  24. }
  25. class GlownaDwa {
  26. void spawnMob() throws InterruptedException {
  27. Cow cow = (Cow) Bukkit.getWorld("world").spawnEntity(location, a);
  28. while (true) {
  29. Thread.sleep(60000);
  30. while (cow.isDead()) {
  31. cow = (Cow) Bukkit.getWorld("world").spawnEntity(location, a);
  32. }
  33. }
  34. }
  35.  
  36. private int x, y, z;
  37. private EntityType a;
  38.  
  39. GlownaDwa(int x, int y, int z, EntityType a) {
  40. this.x = x;
  41. this.y = y;
  42. this.z = z;
  43. this.a = a;
  44. }
  45.  
  46. private World world = Bukkit.getServer().getWorld("world");
  47. private Location location = new Location(world, x, y, z);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement