Introduction What if I told you that you can create a banning system, complete with customize-able ban reasons, the ability to add expiration dates, and the option to choose banning Ips, that only requires one line? This tutorial will show you how to use the built-in Banning system to complete all of the above. This tutorial will be broken down into three parts: Setting up the banlist, setting the custom reasons, and an example. Getting the banlist. There are two banlists that you can choose from: the Name banlist and the IP banlist. The Name banlist will ban a user with a specific name. To get this banlist, you would use Code: Bukkit.getBanList(Banlist.Type.NAME) To get the IP banlist, all you need to do is change "NAME" to "IP". Code: Bukkit.getBanList(Banlist.Type.IP) After you set up the banlist, you will need to use the "addBan" method to ban the player or IP. The parameters for the method are "String [target], String [reason], Date [expires], String [source]". [Target] can either be the player's name or the player's IP. [Reason] is the message that will be displayed if they try to join the server while they are banned. [Expires] is the date the ban will be lifted. Set this to null if you want the player to be permanently banned. [Source] is the source of the ban. You can set this to null. Here is an examples of how you can use it; This will permanently ban the player, displaying the message "you were hacking" if they try to join the server: Code: //ip BanList#addBan(target.getAddress().getHostName(),"You were hacking", null, null); //name BanList#addBan(target.getName(),"You were hacking", null, null); If you want to temperately ban the player, you will have to create a new date object. For example, if you wanted to ban the player for one hour, you would use the following date object instead: Code: Date date = new Date(System.currentTimeMillis()+60*60*1000); //Since there are 1000 miliseconds in one second, 60 seconds in one minute, and 60 minutes in an hour, by adding 60*60*1000 to the current time, you are adding an hour to the bantime. There are many ways to create the date object, but for this example we are using milliseconds to add an hour to ban time. If you wanted to re-add this to the addBan method above, it should look like Code: BanList#addBan(target,"You where hacking",new Date(System.currentTimeMillis()+60*60*1000), null); Important Note: This will only ban the player, and will not kick them off the server. If you want to kick the player off the server, use the following line: Code: player.kickPlayer("Reason"); Where you will replace "reason" with the message you display to the player once they have been kicked. It may be best to use the same message you use above. Custom Ban reason. The default ban message may not be what you want. If you want to create your own custom ban message, you will need to create a "Bumper" to push the old ban reason off the screen. For most screens, the following bumper should move the default message off the screen. Code: String bumper = org.apache.commons.lang.StringUtils.repeat("\n", 35); After creating this object, you can add this before and after your custom reason in order to move the default message of the screen. An example of this would be Code: BanList#addBan(target.getName(),bumper+"You where hacking!"+bumper, null, null); Example: For the people who would want to see how to, as the title says, ban a player using just one line, this would be it: Code: Bukkit.getBanList(BanList.Type.NAME).addBan(player.getName(), org.apache.commons.lang.StringUtils.repeat("\n", 35)+" You have been banned by "+sender.getName()+" \nFor one hour"+org.apache.commons.lang.StringUtils.repeat("\n", 35)",new Date(System.currentTimeMillis()+60*60*1000),null); What this will do is ban the player for one hour, and display the a custom ban message to the player.