Sueta

TempBanAPI | Editable | Simple | Placeholders!

1.4

A TempbanAPI to ban players with just one method.

·Plugin

Information:

  1. I made this because I thought some new people would need it. Also, someone said they had no clue how they would even start with temp-banning, so yeah, here you go lol.
  2. This API is pretty simple yet useful if you don't know how to use time in Java.

Features:

  1. Ability to use an '&' symbol for colors. (Usage: “&cYou have been banned!")
  2. Separate lines with ";;" (Usage: "Line 1;;Line 2")
  3. Very simple to use and install.
  4. Contains placeholders! (%time%, %kicker%, %reason%)
  5. Active author!

Installation:

  1. Download the TempBanAPI.jar onto your computer.
  2. Eclipse: Go back into your IDE and right click on your project.
  3. Hover over 'Build Path' and select 'Configure Build Path..'
  4. Click on 'Add External JARs...' on the right-hand side.
  5. Find where you saved the JAR and double-click it.
  6. Hit OK in the bottom right.
  7. Add the jar to your plugins folder.
  8. You are done! All you need to do is access the method(s)!

Use:

Normal method:

Normal Method
//           Player Time Unit   Banner    Reason          Message
            TBan.tempBan(player, 1, "min", "Server", "Greifing", "You have been banned!");

Using multiple lines:

Multiple Lines
;; Seperates different lines!
            TBan.tempBan(player, 1, "min", "Server", "Greifing", "Line 1;;Line 2;;Line 3");

Valid units of time:

Valid Time Units

sec = Second [Ex: TBan.tempBan(player, 1, "sec", "", "", ""); = 1 Second Ban]

min = Minute [Ex: TBan.tempBan(player, 1, "min", "", "", ""); = 1 Minute Ban]

hour = Hour [Ex: TBan.tempBan(player, 1, "hour", "", "", ""); = 1 Hour Ban]

week = Week [Ex: TBan.tempBan(player, 1, "week", "", "", ""); = 1 Week Ban]

month = Month [Ex: TBan.tempBan(player, 1, "month", "", "", ""); = 1 Month Ban]

year = Year [Ex: TBan.tempBan(player, 1, "Year", "", "", ""); = 1 Year Ban]

Using Placeholders:

Placeholders

%reason% = Reason the player was banned [Greifing]
%kicker% = Who the player was banned by [Server]
%time% = Time left until ban is over [1 minute]

TBan.tempBan(player, 1, "min", "Server", "Griefing", "&cBanned for: %reason% ;; &aBanned By: %kicker% ;; &3Time Left: %time%");

Example:

Make it look like AdvancedBan:

TBan.tempBan(p, 1, "min", "Server", "Greifing", "&cTBanAPI &8&l- &7Temporary Banned!;;;;&cReason: &7%reason%;;;;&cBanned By &8&l> &7%kicker%;;&cTime Left &8&l> &7%time%;;;;&7Appeal on our forums.;;;;&eForum &8&l> &cMyServer.com");
Output



I will update the thread if I think of something else to add, but for now, this is all. If you have any questions or suggestions AT ALL message me on Spigot and I will respond as soon as I see it! :) Please, consider giving this API a rating so I can know if it is useful to you guys/gals on Spigot!

Similar projects

Plugin →