Nocx

CustomEntityFirework_1_9_R1_without_NMS

May 7th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. public void boom(Player p, Location l)
  2.     {
  3.         FireworkEffect effect =         FireworkEffect.builder().trail(false).flicker(false).withColor(Color.RED).withFade(Color.ORANGE).with(FireworkEffect.Type.BALL).build();
  4.          final Firework fw = p.getWorld().spawn(l, Firework.class);
  5.          FireworkMeta meta = fw.getFireworkMeta();
  6.          meta.addEffect(effect);
  7.          meta.setPower(0);
  8.          fw.setFireworkMeta(meta);
  9.          new BukkitRunnable() {
  10.              @Override
  11.              public void run() {
  12.                fw.detonate();
  13.              }
  14.          }.runTaskLater(this, 2L); // this = Plugin class (your Main class )
  15.     }
  16.  
  17. /* Author : Pixpeez | Version : 0.1 | date : 07/05/16 | For Spigot/Bukkit version : 1.9 R1 |
  18. Youtube : http://youtube.com/pixpeez
  19. Twitter : twitter.com/@Cosmonocx */
Advertisement
Add Comment
Please, Sign In to add comment