Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ITEM BOMB
- Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
- @Override
- public void run() {
- for(Item item : arrayis) {
- if(!item.isOnGround()) {
- for(Player p : Bukkit.getOnlinePlayers()) {
- p.spawnParticle(Particle.FLAME,(float) item.getLocation().getX(), (float) item.getLocation().getY(), (float) item.getLocation().getZ(), 1,0.05,0.05,0.05,0);
- p.spawnParticle(Particle.CLOUD,(float) item.getLocation().getX(), (float) item.getLocation().getY(), (float) item.getLocation().getZ(), 1,0.05,0.05,0.05,0);
- p.spawnParticle(Particle.LAVA,(float) item.getLocation().getX(), (float) item.getLocation().getY(), (float) item.getLocation().getZ(), 1,0.05,0.05,0.05,0);
- }
- }
- }
- }
- }, 0, 2);
- @EventHandler
- public void onpickup(PlayerPickupItemEvent e) {
- if(arrayis.contains(e.getItem())) {
- arrayis.remove(e.getItem());
- }
- }
- @EventHandler
- public void onspawn(BlockBreakEvent e) {
- if(e.getBlock().getType() == Material.GLASS) {
- ItemStack is = new ItemStack(Material.DIAMOND);
- ItemStack is1 = new ItemStack(Material.DIAMOND_BLOCK);
- ItemStack is2 = new ItemStack(Material.EXPERIENCE_BOTTLE);
- //SPAWNLOCATION
- Location loc = new Location(Bukkit.getWorld("world"), 11, 79.5, 340);
- //SPAWNITEMS
- Item item1 = Bukkit.getWorld("world").dropItemNaturally(loc, is);
- Item item2 = Bukkit.getWorld("world").dropItemNaturally(loc, is1);
- Item item3 = Bukkit.getWorld("world").dropItemNaturally(loc, is2);
- //ITEMS SET VELOCITY
- item1.setVelocity(item1.getVelocity().multiply(1.7));
- item2.setVelocity(item2.getVelocity().multiply(1.7));
- item3.setVelocity(item3.getVelocity().multiply(1.7));
- //ARRAYLIST ADD
- arrayis.add(item1);
- arrayis.add(item2);
- arrayis.add(item3);
- //SPAWNPARTIKEL
- for(Player p : Bukkit.getOnlinePlayers()) {
- //anzahl,radius x,radiusy ,radius z,keine ahnung);
- p.spawnParticle(Particle.EXPLOSION_LARGE,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 10,0.3,0.3,0.3,0);
- p.spawnParticle(Particle.EXPLOSION_NORMAL,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 15,0.5,0.5,0.5,0);
- p.spawnParticle(Particle.LAVA,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 5,0.5,0.5,0.5,0);
- p.spawnParticle(Particle.CLOUD,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 25,0.7,0.7,0.7,0);
- p.spawnParticle(Particle.FLAME,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 50,1,1,1,0);
- }
- }
- }
- //EXP TOWER
- @EventHandler
- public void onklick(PlayerInteractEvent e) {
- if(e.getAction() == e.getAction().RIGHT_CLICK_BLOCK) {
- Location loc = new Location(Bukkit.getWorld("world"), 5.5, 85.2, 334.5);
- double randomx = ThreadLocalRandom.current().nextDouble(-0.4,0.4);
- double randomy = ThreadLocalRandom.current().nextDouble(0.2, 0.4);
- double randomz = ThreadLocalRandom.current().nextDouble(-0.4, 0.4);
- Bukkit.getWorld("world").spawnEntity(loc, EntityType.THROWN_EXP_BOTTLE).setVelocity(new Vector(randomx, randomy, randomz));
- for(Player p : Bukkit.getOnlinePlayers()) {
- p.spawnParticle(Particle.VILLAGER_HAPPY,(float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), 10,1.2,1.2,1.2,0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement