My Plugin Is Not Working!

Discussion in 'Plugin Development' started by SkyGlue, Feb 16, 2015.

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


    Can someone help me i cant figure this out!!!

    This plugin is supposed to launch a firework when a player joins.
    Help would be incredibly appreciated

    package me.KingMeowww.JoinWidDeFiaWorkz;
    import org.bukkit.Bukkit;
    import org.bukkit.Color;
    import org.bukkit.FireworkEffect;
    import org.bukkit.FireworkEffect.Type;
    import org.bukkit.entity.Firework;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.inventory.meta.FireworkMeta;
    public class Main extends JavaPlugin implements Listener {
            public void onEnable(){
                    Bukkit.getServer().getPluginManager().registerEvents(this, this);
            public void onPlayerJoin (final PlayerJoinEvent pje) {
                            Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
                                    public void run(){
                                            Firework f = (Firework) pje.getPlayer().getWorld().spawn(pje.getPlayer().getLocation(), Firework.class);
                                            FireworkMeta fm = f.getFireworkMeta();
                            }, 20);
    Last edited: Feb 16, 2015
  2. can you send the error, if there is one...
    and what i thought about is that you spawn the firework and edit it after...
    i'd create a new firework, build it and afterwards spawn the firework

    hope this will help
  3. Offline


    First of all, main classes need to have "extends JavaPlugin" and take a look at this video if you still don't know how to do it
  4. Offline


    Thank you all :D This help alot :D
  5. @SkyGlue If you're problem is solved, please set this thread to "Solved" by going to Thread Tools > Edit Title > Prefix > Solved. :)
Thread Status:
Not open for further replies.

Share This Page