Firework effects?

Discussion in 'Plugin Development' started by sebcio98, Apr 8, 2016.

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

    sebcio98

    Hi. I'm trying to spawn a firework effect. None of the things I've tried work :/
    - no packet for firework effect (well, that would be too easy, wouldn't it?)
    - if I spawn a firework then make it explode instantly or with <0.5s delay the firework appears, then disappears with no effect
    - this* doesn't work (since it's outdated, duh) - same effect as above

    Is it impossible or am I missing something?

    * - This code just spawns a firework with given effects and calls (invokes, actually) a method, which is called when a firework explodes.
     
    ShowbizLocket61 likes this.
  2. Offline

    Gonmarte

    Although learning with youtube is not that good cuz u can get bad habits, I will give you a link that might help you -
    Remember i gave you this link, not for you to copy paste the code, but for you to learn. If you think that is bad explained, tag me back.
    You can also check the javadocs - https://hub.spigotmc.org/javadocs/bukkit/index.html?org/bukkit/entity/Firework.html
     
  3. Offline

    sebcio98

    I would love to say that your post is helpful, but it is not :(
    The film you sent is not related to the problem, it's author just explains how to spawn a firework, what I already did and even said that above. I also mentioned that I made the firework explode right after spawning it, which can only be done through detonate(), that I found in the Javadocs, or NMS.

    You know, I listed what I've already tried to keep this thread clear from answers, that don't bring anything new to the conversation. Sadly, yours is one of them.

    Maybe it's my fault for not making the topic clear enough. If so, then sorry. I'll explain it again. I want to spawn a firework effect, not the firework. It would be great to directly spawn the effect, but if that's impossible, the firework spawning and removing 1 tick later to only see the effect is also a solution.
     
  4. Offline

    Gonmarte

    So you wanna spawn the explosion of a firework only?
     
  5. Offline

    Zombie_Striker

    @sebcio98
    You have to spawn if the particle effects. This can either be done using the playerEffect method or through packets. If you wish to use packets, you can either use ProtocolLib or look at the following link:
    http://wiki.vg/Protocol

    If you can't find anything for packets or playEffect, using the fire's .detonate method seems like the next easiest thing to achieve what you want.
     
  6. Offline

    ShowbizLocket61

    @Zombie_Striker
    ProtocolLib should be limited to what NMS is also limited to
     
  7. Offline

    mcdorli

    Theres no such particle as "firewor particle"
     
  8. Offline

    sebcio98

    @Gonmarte Yes.
    @Zombie_Striker I guess you mean playEffect. Firework is an entity and it's explosion is not an Effect. With detonate() there's no explosion effect if it was called <0.5s since the firework was spawned.
     
Thread Status:
Not open for further replies.

Share This Page