Bungeecord Alert

Discussion in 'BungeeCord Plugin Development' started by ItsJorden, May 9, 2015.

Thread Status:
Not open for further replies.
  1. Alright, I know you can use &h to remove the alert prefix but I want someone to create a plugin where you can override and change the entire format to what ever in a config file.

    You could have variable to get the player who sent the alert and get what servers its sent to.

    What I am think of:
    Code (Text):
    &8&l-----------------------------------------------------------------------------
                   (unicode Charcter here) &c&lNetwork Alert (unicode Charcter here)
                        &esent by PLAYER

                                     &7 Message
    &8&l-----------------------------------------------------------------------------
    If I need to include something, let me know. Thanks!
     
  2. Post your code so far.
     
  3. I am basically trying to make a new module to replace the cmd_alert one.
    So far no luck. (Got this from the md_5 Module repo)
    Code (Text):
    import net.md_5.bungee.api.ChatColor;
    import net.md_5.bungee.api.CommandSender;
    import net.md_5.bungee.api.ProxyServer;
    import net.md_5.bungee.api.plugin.Command;

    public class CommandAlert extends Command
    {

        public CommandAlert()
        {
            super( "alert", "bungeecord.command.alert" );
        }

        @Override
        public void execute(CommandSender sender, String[] args)
        {
            if ( args.length == 0 )
            {
                sender.sendMessage( ChatColor.RED + "You must supply a message." );
            } else
            {
                StringBuilder builder = new StringBuilder();
                if ( args[0].startsWith( "&h" ) )
                {
                    // Remove &h
                    args[0] = args[0].substring( 2, args[0].length() );
                } else
                {
                    builder.append( ProxyServer.getInstance().getTranslation( "alert" ) );
                }

                for ( String s : args )
                {
                    builder.append( ChatColor.translateAlternateColorCodes( '&', s ) );
                    builder.append( " " );
                }

                String message = builder.substring( 0, builder.length() - 1 );

                ProxyServer.getInstance().broadcast( message );
            }
        }
    }
    EDIT: I just realized I posted in the wrong sub-forum.
     
  4. jflory7

    jflory7 Retired Moderator
    Retired Benefactor

    Thread moved => BungeeCord Plugin Development
     
  5. Thanks Much
     
  6. Inkzzz

    Resource Staff

    You can't override the commands already on BungeeCord.
     
  7. I know that they are through module's in the module folder. Can't I simply change that alert module?
     
  8. JamesJ

    Supporter

    Yes you can.
     
  9. Inkzzz

    Resource Staff

    Wait? You can?
     
  10. JamesJ

    Supporter

    Yes...
     
  11. So any suggestions?
     
  12. I'm still looking for an answer
     
Thread Status:
Not open for further replies.