Instant explosive firework

Discussion in 'Plugin Development' started by Jumb_1907, Mar 22, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    Jumb_1907

    Hey,

    How can I make a firework explode when I trigger the line of code.

    Code:
                Firework f = (Firework) entity.getWorld().spawn(entity.getLocation(), Firework.class);
               
                FireworkMeta fm = f.getFireworkMeta();
                fm.addEffect(FireworkEffect.builder()
                                .flicker(false)
                                .trail(true)
                                .with(Type.BALL)
                                .withColor(Color.YELLOW)
                                .withFade(Color.BLACK)
                                .build());
    
                               
                fm.setPower(1);
               
                f.setFireworkMeta(fm);
     
  2. Offline

    mine-care

    Is this what you are looking for?
     
Thread Status:
Not open for further replies.

Share This Page