TempBanAPI | Editable | Simple | Placeholders!
1.4A TempbanAPI to ban players with just one method.
Information:
- 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.
- This API is pretty simple yet useful if you don't know how to use time in Java.
Features:
- Ability to use an '&' symbol for colors. (Usage: “&cYou have been banned!")
- Separate lines with ";;" (Usage: "Line 1;;Line 2")
- Very simple to use and install.
- Contains placeholders! (%time%, %kicker%, %reason%)
- Active author!
Installation:
- Download the TempBanAPI.jar onto your computer.
- Eclipse: Go back into your IDE and right click on your project.
- Hover over 'Build Path' and select 'Configure Build Path..'
- Click on 'Add External JARs...' on the right-hand side.
- Find where you saved the JAR and double-click it.
- Hit OK in the bottom right.
- Add the jar to your plugins folder.
- 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 →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta