Please Help, Instant Fireworks

Discussion in 'Plugin Development' started by ChintziSecilMC, Oct 5, 2015.

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

    ChintziSecilMC

    For some odd reason this has just stopped working i am very confused why because i hvant changed anything or updated my plugin so i was wondering if anyone had some different code of recommendations to how to could change this to a method that works

    Thanks

    Code:
        public static void spawnInstant(Location l, boolean flicker, Color color, Color fade, FireworkEffect.Type type, boolean trail) {
            Firework fw = (Firework) l.getWorld().spawnEntity(l, EntityType.FIREWORK);
            FireworkMeta meta = fw.getFireworkMeta();
            FireworkEffect effect = FireworkEffect.builder()
                    .flicker(flicker)
                    .withColor(color)
                    .withFade(fade)
                    .with(type)
                    .trail(trail)
                    .build();
            meta.addEffect(effect);
            fw.setFireworkMeta(meta);
            ((CraftFirework) fw).getHandle().expectedLifespan = 1;
        }
     
  2. Offline

    mcdorli

    @ChintziSecilMC Did this ever work? If yes, check your particle settings.
     
Thread Status:
Not open for further replies.

Share This Page