Spawn fireworks to reach the maximum points (Plugin)

Discussion in 'Plugin Development' started by Texgabs, Aug 27, 2015.

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

    Texgabs

    I work in a plugin of HousePoints, (my server is based in harrypotter)
    I need a house when you reach the maximum number of points , spawn fireworks in an established location, and say something like ! Gryffindor was won the cup !


    "If you need my source code to corroborate my question please feel free to ask me" :)

    Thanks

    Perdón por mi Ingles , mi lengua nativa es el Español.
     
  2. Offline

    NovusTheory

    Use the spawnEntity() method with an EntityType of Firework
    Code:
    World.spawnEntity(Location, EntityType.FIREWORK)
    As for everything else, It really is up to how you program the rest of that to make it check and or work.
    e.g. using custom Lists or Maps to store information of players or using Minecrafts Level system
     
  3. Offline

    Zombie_Striker

    Well this doesn't feel like an advertisement at all.

    As NovusTheory said above, spawn the firework using the spawnEntity method. SpawnEntity returns an entity instance ,so you can create a FireWork field by casting his method to a FireWork. After that, you can modify the color, effects and more if you want.

    We will not code for you, and you are not getting any errors, so we don't need your code.
     
  4. Offline

    au2001

    Better use World#spawn(Location, Firework.class) and save it in a Firework variable.
    Then use FireworkEffect#builder() to create your effects.
    (see http://jd.bukkit.org/org/bukkit/FireworkEffect.Builder.html)
    And finally do FireworkMeta#addEffect() (you could also use FireworkMeta#setPower()).

    Note: to get the FireworkMeta, use Firework#getFireworkMeta() and don't forget to Firework#setFireworkMeta().
     
Thread Status:
Not open for further replies.

Share This Page