Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. //ITEM BOMB
  2.  
  3. Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
  4.  
  5. @Override
  6. public void run() {
  7.  
  8. for(Item item : arrayis) {
  9.  
  10. if(!item.isOnGround()) {
  11. for(Player p : Bukkit.getOnlinePlayers()) {
  12. p.spawnParticle(Particle.FLAME,(float) item.getLocation().getX(), (float) item.getLocation().getY(), (float) item.getLocation().getZ(), 1,0.05,0.05,0.05,0);
  13. p.spawnParticle(Particle.CLOUD,(float) item.getLocation().getX(), (float) item.getLocation().getY(), (float) item.getLocation().getZ(), 1,0.05,0.05,0.05,0);
  14. p.spawnParticle(Particle.LAVA,(float) item.getLocation().getX(), (float) item.getLocation().getY(), (float) item.getLocation().getZ(), 1,0.05,0.05,0.05,0);
  15.  
  16. }
  17. }
  18.  
  19. }
  20.  
  21. }
  22. }, 0, 2);
  23.  
  24. @EventHandler
  25. public void onpickup(PlayerPickupItemEvent e) {
  26.  
  27. if(arrayis.contains(e.getItem())) {
  28. arrayis.remove(e.getItem());
  29. }
  30.  
  31. }
  32.  
  33. @EventHandler
  34. public void onspawn(BlockBreakEvent e) {
  35.  
  36. if(e.getBlock().getType() == Material.GLASS) {
  37.  
  38. ItemStack is = new ItemStack(Material.DIAMOND);
  39. ItemStack is1 = new ItemStack(Material.DIAMOND_BLOCK);
  40. ItemStack is2 = new ItemStack(Material.EXPERIENCE_BOTTLE);
  41.  
  42. //SPAWNLOCATION
  43. Location loc = new Location(Bukkit.getWorld("world"), 11, 79.5, 340);
  44.  
  45. //SPAWNITEMS
  46. Item item1 = Bukkit.getWorld("world").dropItemNaturally(loc, is);
  47. Item item2 = Bukkit.getWorld("world").dropItemNaturally(loc, is1);
  48. Item item3 = Bukkit.getWorld("world").dropItemNaturally(loc, is2);
  49.  
  50. //ITEMS SET VELOCITY
  51. item1.setVelocity(item1.getVelocity().multiply(1.7));
  52. item2.setVelocity(item2.getVelocity().multiply(1.7));
  53. item3.setVelocity(item3.getVelocity().multiply(1.7));
  54.  
  55. //ARRAYLIST ADD
  56. arrayis.add(item1);
  57. arrayis.add(item2);
  58. arrayis.add(item3);
  59.  
  60. //SPAWNPARTIKEL
  61. for(Player p : Bukkit.getOnlinePlayers()) {
  62. //anzahl,radius x,radiusy ,radius z,keine ahnung);
  63. p.spawnParticle(Particle.EXPLOSION_LARGE,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 10,0.3,0.3,0.3,0);
  64. p.spawnParticle(Particle.EXPLOSION_NORMAL,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 15,0.5,0.5,0.5,0);
  65. p.spawnParticle(Particle.LAVA,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 5,0.5,0.5,0.5,0);
  66. p.spawnParticle(Particle.CLOUD,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 25,0.7,0.7,0.7,0);
  67. p.spawnParticle(Particle.FLAME,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 50,1,1,1,0);
  68.  
  69. }
  70.  
  71. }
  72.  
  73. }
  74.  
  75.  
  76.  
  77. //EXP TOWER
  78. @EventHandler
  79. public void onklick(PlayerInteractEvent e) {
  80.  
  81. if(e.getAction() == e.getAction().RIGHT_CLICK_BLOCK) {
  82.  
  83. Location loc = new Location(Bukkit.getWorld("world"), 5.5, 85.2, 334.5);
  84.  
  85. double randomx = ThreadLocalRandom.current().nextDouble(-0.4,0.4);
  86. double randomy = ThreadLocalRandom.current().nextDouble(0.2, 0.4);
  87. double randomz = ThreadLocalRandom.current().nextDouble(-0.4, 0.4);
  88.  
  89.  
  90. Bukkit.getWorld("world").spawnEntity(loc, EntityType.THROWN_EXP_BOTTLE).setVelocity(new Vector(randomx, randomy, randomz));
  91.  
  92. for(Player p : Bukkit.getOnlinePlayers()) {
  93.  
  94. p.spawnParticle(Particle.VILLAGER_HAPPY,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 10,1.2,1.2,1.2,0);
  95.  
  96. }
  97. }
  98.  
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement