Spawning just a firework effect

Discussion in 'Plugin Development' started by dcgamingentral, Apr 18, 2014.

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

    dcgamingentral

    Hi,

    I am trying to have a firework effect spawn when a player dies but I don't want the firework, just the effect.

    This is the code I've tried using but the firework rises before it explodes:

    Code:
            Firework fw = (Firework) player.getWorld()
                    .spawnEntity(player.getLocation(), EntityType.FIREWORK);
            FireworkMeta fwm = fw.getFireworkMeta();
            FireworkEffect effect = FireworkEffect.builder().withColor(Color.RED)
                    .with(FireworkEffect.Type.BALL).flicker(true).trail(true).build();
            fwm.addEffect(effect);
            fwm.setPower(0);
            fw.setFireworkMeta(fwm);
            ((CraftWorld)matchPlayer.getBukkit().getWorld()).getHandle().broadcastEntityEffect( ((CraftFirework)fw).getHandle(), (byte)17);
    fireblast709

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  2. Offline

    Norbu10

    There are librarys for that check the Bukkit Forums>Plugin Development> Resources
     
Thread Status:
Not open for further replies.

Share This Page