- Contributors:
- TheTrollz
This is my very first resource on Spigot, and it's name is TitleAPI.
TitleAPI is a very easy to use Title and Tab Header Footer system for developers AND server owners and also works in all current 1.8 AND 1.9 builds of Spigot/Bukkit.
The API can be used like this:
Code (Text):TitleUtils.getInstance().sendTitle(e.getPlayer(), "&cText!", "&eSubText!", 20, 60, 20);Code (Text):TabUtils.getInstance().sendTab(e.getPlayer(), "&cText!", "&eSubText!");
![]()
Tab Header/Footer animations are possible and run off of the AnimationRunnable class, or if you're a server owner, the config.yml file, and your animation's file.
There is currently one placeholder, %newline%.Code (Text):AnimationRunnable runnable = new AnimationRunnable("example"); // example is the file the animation is in
runnable.runTaskTimerAsynchronously(TitleAPI.getInstance(), 0, ConfigManager.getInstance().readAnimation("example").getInt("speed")*20);Code (Text):frames:
header:
- '&aTitleAPI v1.1'
- '&cT&aitleAPI v1.1'
- '&aT&ci&atleAPI v1.1'
- '&aTi&ct&aleAPI v1.1'
- '&aTit&cl&aeAPI v1.1'
- '&aTitl&ce&aAPI v1.1'
- '&aTitle&cA&aPI v1.1'
- '&aTitleA&cP&aI v1.1'
- '&aTitleAP&cI &av1.1'
- '&aTitleAPI &cv&a1.1'
- '&aTitleAPI v&c1&a.1'
- '&aTitleAPI v1&c.&a1'
- '&aTitleAPI v1.&c1'
footer:
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
- '&aThis is the example animation! You can edit this in example.yml!'
speed: 1
They can also be created with code, no files needed:
Code (Text):List<String> header = new ArrayList<>();
List<String> footer = new ArrayList<>();
header.add("&aThis is line #1! %newline% &aand this is line #2!");
header.add("&bThis is line #1! %newline% &band this is line #2!");
header.add("&cThis is line #1! %newline% &cand this is line #2!");
header.add("&dThis is line #1! %newline% &dand this is line #2!");
footer.add("&aIP: mc.Example.net %newline% &aStore @ store.Example.net");
footer.add("&bIP: mc.Example.net %newline% &bStore @ store.Example.net");
footer.add("&cIP: mc.Example.net %newline% &cStore @ store.Example.net");
footer.add("&dIP: mc.Example.net %newline% &dStore @ store.Example.net");
AnimationRunnable runnable = new AnimationRunnable(header, footer);
runnable.runTaskTimerAsynchronously(TitleAPI.getInstance(), 0, 20);
There are currently three events, PlayerSentTitleEvent, PlayerSentTabEvent, and AnimationCycleEvent. You have the ability to change all of the variables, including the player.
Or, you could print the output of each title sent. You can even cancel the title! The possibilities are somewhat endless!
Example:
Code (Text):@EventHandler
public void onTitle(PlayerSentTitleEvent e){
System.out.print("PlayerSentTitleEvent executed: ");
System.out.print("Player: " + e.getPlayer().getName());
System.out.print("Title: " + e.getTitle());
System.out.print("SubTitle: " + e.getSubtitle());
System.out.print("In: " + e.getIn());
System.out.print("Stay: " + e.getStay());
System.out.print("Out: " + e.getOut());
}Code (Text):[21:05:30 INFO]: PlayerSentTitleEvent executed:
[21:05:30 INFO]: Player: TheTrollz
[21:05:30 INFO]: Title: &cText!
[21:05:30 INFO]: SubTitle: &eSubText!
[21:05:30 INFO]: In: 0
[21:05:30 INFO]: Stay: 60
[21:05:30 INFO]: Out: 20
You are free to use this any way you want, as long as:
- You give me credit
- You don't use this in any way that breaks Mojang's EULA and/or Terms
- You don't use this in any way that breaks SpigotMC's EULA and/or Terms
- I can update this resource at any time, and add anything to it that doesn't violate SpigotMC's plugin guidelines.
- I don't have to update this plugin or provide support
- Errors will be PM'd to me instead of left in the review section
Thanks for looking at my resource!

TitleAPI 1.5-RELEASE
An extensive API and server owner resource for titles and tab headers & footers
Recent Updates
- Fixed Bugs Mar 13, 2016
- The 1.9 Update Mar 1, 2016
- Multiple additions, see update description Nov 21, 2015