[GEN] playerList v0.1 - List all players online [798]

Discussion in 'Inactive/Unsupported Plugins' started by lolcoder, May 7, 2011.

  1. Offline

    lolcoder

    playerList: a simple plugin for listing players.

    Version: v0.1

    For list players online, type /whoisonline or just /online. The simplest plugin ever. 0.2 lines of code.

    Features:
    • List online players
    Download Plugin

    Changelog:
    Version 0.1
    • Uploaded the plugin
    Ps: I searched but if there are others plugins for the same thing sorry.
     
  2. Offline

    Digi

    A 3-word command is kinda long :} ... can you add some aliases like /players or /online ?
     
  3. Offline

    lolcoder

    Added /online.
     
  4. Offline

    Trust518

    Just asking. Am i able to change the command for exaple instead of /online then /who
    ?
     
  5. Offline

    lolcoder

    No, sorry.
     
  6. Offline

    kahlilnc

    what about /list
     
  7. Offline

    lolcoder

    Added /list, it's better. Thanks.
     
  8. Offline

    Plague

  9. Offline

    woodzy

    err add /players
     
  10. Offline

    Αρρεν

    Can't understand, for what this plugin?
    Command 'list' is doing list of online players.
     
  11. Offline

    lolcoder

    @Αρρεν: I didn't know. I think here we can close or delete.
     
  12. Offline

    Αρρεν

    //offtop: how did you get Plugin Developer status???
     
  13. Offline

    lolcoder

    @Αρρεν: By making this and an another plugin.
     
  14. Offline

    noahwhygodwhy

    /list is already included, it's a cool plugins with no bugs but it's already in the server.
     
  15. Offline

    Αρρεν

    Thx C.O. but we know it ))))))
     
  16. Offline

    killervalon

    /list is only for OP's... So this is infact useful.
     
  17. Offline

    killerrj8

    lol nice :) can u also add "/Who" ?
     
  18. Offline

    OliTheG

    what happened to /list?

    You know, the thing that is in the server BY DEFAULT?
     
  19. Offline

    lolcoder

    @OliTheG: I didn't know when I made this plugin.
     
  20. Offline

    Zeroi9

    Seriously, @OliTheG, @noahwhygodwhy,
    @lolcoder
    Only OP's can write /list ingame!
     
  21. Offline

    lolcoder

    So my plugin is useful. Wow. lol
     
  22. Offline

    fregaPT I steal plugins as my own

    Hey there,
    Is there any way of posting the source code (the listeners, .yml, main) ?
    In github or just post it in code here?
     
  23. Offline

    lolcoder

    Yes, but... why? There are like 10 lines of (bad) code...
     
  24. Offline

    PCITJunior

    EN:
    Make a Text file with a list where everyone can write down what for commands he wanz to use.

    DE:
    Erstell ein Textdokument mit einer Liste in der jeder schreiben kann, welche Befehle er nutzen möchte.
     
  25. Offline

    chrcms

    When using this pluing I cant use the "list" command directly from the server

    Getting this error:
    >list
    23:15:31 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'list
    ' in plugin playerList v0.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85
    )
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:2
    47)
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:394)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:379)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.command.Coloured
    ConsoleSender cannot be cast to org.bukkit.entity.Player
    at lolcoder.playerList.plCommand.onCommand(plCommand.java:12)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 6 more
     
  26. Offline

    fregaPT I steal plugins as my own

    Hey there
    Can u post the source code ?
    Or maybe in github ?
    Thank you
    //Great Plugin :D
     
  27. Offline

    OmegaII

    list in console is idd broken
     
  28. Offline

    lolcoder

    List from console fixed, and here the source. Sorry for the bad code, I'm not very good at programming:
    Show Spoiler

    plCommand.java
    Code:
    package lolcoder.playerList;
    
    import java.util.logging.Logger;
    
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    
    public class plCommand implements CommandExecutor {
    
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
            try {
                Player player = (Player) sender;
                String str = ChatColor.RED + "Online: " + player.getName();
                for(Player p : player.getServer().getOnlinePlayers()) {
                    if(!(player.getName().equals(p.getName()))) str += ", " + p.getName();
                }
                player.sendMessage(str);
                return true;
                }
            catch(Exception e) {
                String str = "Online: ";
                for(Player p : sender.getServer().getOnlinePlayers()) {
                    str += p.getName() + ", ";
                }
                Logger.getLogger("Minecraft").info(str);
                return true;
            }
        }
    
    }
    playerList.java
    Code:
    package lolcoder.playerList;
    
    import java.util.logging.Logger;
    
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class playerList extends JavaPlugin {
        plCommand tpCmd = new plCommand();
        private static final Logger log = Logger.getLogger("Minecraft");
    
        public void onEnable() {
            log.info("[playerList] Plugin Enabled.");
            getCommand("whoisonline").setExecutor(tpCmd);
            getCommand("online").setExecutor(tpCmd);
            getCommand("list").setExecutor(tpCmd);
        }
    
    
        public void onDisable() {
            log.info("[playerList] Plugin disabled.");
        }
    
    
    }
     
  29. Offline

    tharvoil

    This plugin is literally what I need, one request however. Add one line to the beginning that prints out the number of online players. Makes my life easier than counting by hand (constantly 30+ online). If you do that I would love you forever.
     
  30. Offline

    Chuckster

    could you make it so that /list can be used by the server it self
     

Share This Page