Version 0.3 fixes some class names from Version 1. I created this library for those who do not know how to utilise the new Craftbukkit/Spigot Title and Action bar text functions. The library is licenced under "BSD".
Examples:
Send player title on join:
Send player action bar text if they break diamond ore:
Examples:
Send player title on join:
Code (Text):
private BukkitText text = new BukkitText();
@Eventhandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
String title = "&cWelcome &b" + player.getName() + " &cto the server!"
String subtitle = "&4Enjoy your stay!"
// all times are in ticks, as a heads up
int fadeIn = 20;
int viewTime = 60;
int fadeOut = 20;
text.sendTitleText(subtitle, title, player, fadeIn, viewTime, fadeOut);
}
@Eventhandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
String title = "&cWelcome &b" + player.getName() + " &cto the server!"
String subtitle = "&4Enjoy your stay!"
// all times are in ticks, as a heads up
int fadeIn = 20;
int viewTime = 60;
int fadeOut = 20;
text.sendTitleText(subtitle, title, player, fadeIn, viewTime, fadeOut);
}
Code (Text):
private BukkitText text = new BukkitText();
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
Player player = e.getPlayer();
String message = "&6Congrats! You just mined &bDiamond ore&6!";
if(e.getBlock().getType() == Material.DIAMOND_ORE) {
text.sendActionBarText(message, player);
}
}
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
Player player = e.getPlayer();
String message = "&6Congrats! You just mined &bDiamond ore&6!";
if(e.getBlock().getType() == Material.DIAMOND_ORE) {
text.sendActionBarText(message, player);
}
}
Quick facts
- Edition: Minecraft Java
- File type: .jar
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
BukkitText Library is a free Minecraft Java mod. Downloaded 289 times (via Spigot). Download it and open it directly in the game.