Fire a firework from a bow and make it explode on impact

Discussion in 'Plugin Development' started by spideynn, Aug 8, 2013.

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

    spideynn I steal plugins as my own

    So what I am trying to do is fire a firework from a bow and make it explode on impact, but only do damage to other players.

    I tried to use FireworkEffectPlayer, but it didn't help.

    Any suggestions to how I can do this?

    (The plugin is supposed to be like the Wither Skeleton Class in SuperCraftBros)
     
  2. Offline

    PropGamer

    REMOVED.

    The code wouldn't work /
     
  3. Offline

    Seadragon91

    @PropGamer this
    Code:
     FireWork f = e.getPlayer().launchProjectile(FireWork.class);
    can't work. FireWork doesn't extends the class projectile.
     
  4. Offline

    valon750

    Code:
                            Firework fw = (Firework) player.getWorld().spawnEntity(player.getLocation(), EntityType.FIREWORK);
                            FireworkMeta fwm = fw.getFireworkMeta();
                         
                            FireworkEffect effect = FireworkEffect.builder().flicker(true).withColor(Color.fromRGB(255, 0, 0)).withFade(Color.fromRGB(0, 255, 0)).with(Type.BURST).trail(true).build();
                            fwm.addEffect(effect);
                            Integer power = -1;
                            fwm.setPower(power)
                            fw.setFireworkMeta(fwm);
    If I remember correctly, this is what I used...

    Edit:
    Do note that the colours are red and blue, just as a template!
     
  5. Offline

    spideynn I steal plugins as my own

    I'll try this and see if it will work. I'll edit the post if it works or not.

    valon750 I get these errors:

    (picture of eclipse)
    [​IMG]

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

    valon750

    spideynn

    Well in the event of the code I supplied, this is more centred on if a player for example, clicks a certain block.

    Your code doesn't seem to specify an event.
     
  7. Offline

    Assist

    spideynn
    You should really look into the basics of plugin development, before even thinking about doing something like this.
     
  8. Offline

    spideynn I steal plugins as my own

    Assist You know that is not my full code, right?
     
Thread Status:
Not open for further replies.

Share This Page