Help me make this into a .jar file

Discussion in 'Plugin Development' started by amaranone, Jan 19, 2015.

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

    amaranone

    Here is the code, could someone do this for me cause Its not letting me
    Code:
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Random;
    import me.confuser.barapi.BarAPI;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    public class Example extends JavaPlugin implements Listener {
    
        private Random r = new Random();
    
        private List<String> list = new ArrayList<>();
    
        public void onEnable() {
            list.add(colorize("&1 JOIN THE"));
            list.add(colorize("&2 JOIN THE"));
    
            showBarChanging();
        }
    
        private String colorize(String input) {
            return ChatColor.translateAlternateColorCodes('&', input);
        }
    
        public void showBarChanging() {
        Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
                public void run() {
                    String message = (String) list.get(r.nextInt(list.size()));
    
                     for (Player p : Bukkit.getOnlinePlayers()) {
                         BarAPI.setMessage(p, message);
                     }
                 }
             }, 0, 1 * 20);
         }
    }
    
     
  2. Offline

    timtower Administrator Administrator Moderator

    @amaranone And why isn't it letting you?
    Removed advertisement btw.
     
  3. Offline

    amaranone

  4. Offline

    Gerov

  5. Offline

    amaranone

    @Gerov Its supposed to stay on at all times. Could you make it into a jar for me?
     
  6. Offline

    Skionz

    Overriding the onDisable method is not required.
     
  7. Offline

    Tecno_Wizard

    @amaranone, that could not possibly be any more vague. What kind of error is it? Java syntax, invalid SDK, ect.
     
  8. Offline

    glasseater

    @amaranone If you're talking about the error you get when you export it, it's ok. It still makes it into a jar.
     
  9. Offline

    amaranone

  10. Offline

    drpk

    @amaranone download the JDK and build with it.
     
Thread Status:
Not open for further replies.

Share This Page