How to create a Firework?

Discussion in 'Plugin Development' started by hice3000, Dec 22, 2012.

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

    hice3000

    I think I was using the #2565 build, and it worked perfect, try using this one!

    EDIT: AND be sure you are using the same build on your test-server, too!
     
  2. Offline

    RealDope

    #2565 didn't work for me, so I waited all these hours for #2566. And just NOW I realize that 2565 DID work, but I had only updated my build path, and not my server's craftbukkit.jar...............

    Any idea about my problem right above you?
     
  3. Offline

    hice3000

    No, Im not so fimilar with this, I got the solution from lol768, too.
     
  4. Offline

    RealDope

  5. Offline

    Serilum

    Latest dev build seem to have fixed those errors!
     
    Felixx61 and lol768 like this.
  6. Offline

    RealDope

    The latest dev build fixed the duration errors?
     
  7. Offline

    Serilum

    There were some errors with spawning the firework event, not sure what you are on about ;)
     
  8. Offline

    RealDope

    Ah well, my post a few up is a problem I'm having with duration of fireworks. I stored the FireworkMeta and then add it to a firework later and launch that, but the duration is reeally short. Like shorter than even a duration 1 would be.

    Also, maybe it's un-related to my problem, but when I spawn a firework with my plugin rather than right clicking in-game, it's really choppy and buggy when it flies up. Anyone else see this?

    EDIT: After testing, it IS storing the duration properly, (1-3), it's just not acting on it correctly. All durations are much too short.
     
  9. Offline

    KingMagnus

    Sir I love your code and stick with me on this the plugin I made makes trails of particles that follow you and your code here makes random fireworks pop up so I'll just go and out that 2 together.
    EDIT: Well fuck, bukkit won't let me spawn the fireworks as an entity :/
     
  10. Offline

    fireblast709

  11. Offline

    KingMagnus

    I'm using the latest beta build, so I'm guessing it won't be sufficient.
     
  12. Offline

    fireblast709

  13. Offline

    KingMagnus

  14. Offline

    fireblast709

    Like? (I am quite interested in fireworks, as you could possibly use them as weapons ;3)
     
  15. Offline

    tommycake50

    like in cannons?
    i dont think it would hurt the player and it doesnt count as a projectile i dont think but :p nice idea.
    it would probs hit the player and explode.
     
  16. Offline

    fireblast709

    What about creating a real explosion, or splash effects :p. You could also run a nearby players check and damage/affect them. Bukkit's endless possibilities
     
  17. Offline

    tommycake50

    yeah i was thinking that xD is there a FireworkExplodeEvent? then it would be a lot easier.
     
  18. Offline

    macmc

    My fireworks won't explode...
    Code:
    Firework f= (Firework) l.getWorld().spawnEntity(player.getLocation(), EntityType.FIREWORK);
    FireworkEffect effect = FireworkEffect.builder().withColor(Color.RED).with(Type.BALL_LARGE).build();
    f.getFireworkMeta().addEffect(effect);
    f.getFireworkMeta().setPower(1);
    EDIT: With your code it works, I guess I didn't put enough arguments for the builder
     
  19. Offline

    Rprrr

    No. You forgot to add the meta to the fireworks.
     
  20. Offline

    macmc

    Weird though, I would have thought that modifying the meta from the getFireworkMeta would work without having to set it once again...
    I still don't manage to make the firework go exactly straight, it always wants to fly in the air, even if it's just a little bit...
    Hope I won't have to change the minecraft code and to create custom fireworks...
    Has anyone a solution for me?
     
  21. Offline

    KingMagnus

    Well when I did that it threw them as a sort of grenade but the thing is too many at once crash your client, They do react weirdly with blocks so they end up colliding off of anything they hit and jumping in the direction it bounced from.
     
  22. Offline

    macmc

    omg, is there no fireworkExplosionEvent? I could'nt detect when the firework exploded, and I highly need it!
     
  23. Offline

    -_Husky_-

    I'm sure there will be an API soon enough, after christmas pudding.
     
  24. Offline

    macmc

    Too bad I was about to create a new character, Santa Claus for my RP system... Needed these god-dam fireworks, but looks like I will have to wait...
     
  25. Sorry for late reply. Hope everyone got their fireWORKs! Pretty lame pun, eh? :D
     
  26. Offline

    nitrousspark

    its not working for me. im getting this error in the consol

    Caused by: java.lang.IllegalArgumentException: Cannot spawn an entity for org.bukkit.entity.Firework
     
  27. Offline

    fireblast709

    Update Craftbukkit
     
Thread Status:
Not open for further replies.

Share This Page