Fireworks

Discussion in 'Plugin Development' started by CactusComboPvP, May 16, 2014.

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

    CactusComboPvP

    Hello, I am coding a Harry Potter plugin.
    Currently I am working on the wands.
    What I have: Type /wand and it gives you a wand with a random core, wood and inch.

    What I need, when you right click a stick with the display name 'Wand'
    It shoots out a firework at eye location also I need the trail to be red sparks

    If you can do this, thank's so much!

    Extra:

    If you're a real support, could you add in, so if it hits a player it sends that player a message 'You have been disarmed!'

    Thanks so much!
     
  2. Offline

    Mr360zack

  3. Offline

    CactusComboPvP

    I tried it but failed, could someone give me the code please?
     
  4. Offline

    NathanWolf

    We don't want to spoonfeed you code here, but you don't need a lib for this.

    You will need to spawn a Firework Entity, search for more info about entity spawning, or about this specific topic since it's probably been covered already :)

    If you just want the effect and not to actually launch a firework, this can be done in 1.7 with the new detonate() method, just call it right after spawning the Firework entity.

    Since it is admittedly a little weird to build a FireworkEffect, I can also share some of my own code to point you in the right direction there:

    https://github.com/elBukkit/MagicLi...lmakers/mine/bukkit/spell/BaseSpell.java#L612

    There's a lot of specific stuff in there about where I get the colors from, and also some randomization you could use if you wanted to. Hopefully it's enough to give you the right idea.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page