1

Bukkit plugin:title help

pieterx12's Avatar pieterx1211/11/15 8:22 am
1 emeralds 323 3
11/11/2015 12:11 pm
TomPoTheGamer's Avatar TomPoTheGamer
Hey guys
I wanna to program a plugin for loginmessages but the title that needs to show up doesn't want to work can someone help me ?
public void onDisable() {
PluginDescriptionFile pdfFile = getDescription();
Logger logger = Logger.getLogger("Minecraft");

logger.info(pdfFile.getName() + " has been disabled (V." + pdfFile.getVersion() + ")");
}

@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();

PacketPlayOutTitle welcomeTitle = new PacketPlayOutTitle(EnumTitleAction.TITLE,
ChatSerializer.a("/title @a title[{text:'WELCOME',color:'gold'"), 20, 40, 30);

PlayerConnection connection = ((CraftPlayer)p).getHandle().playerConnection;
connection.sendPacket(welcomeTitle);

p.sendMessage("Welcome!");
}
}

-Tnx
Posted by pieterx12's Avatar
pieterx12
Level 8 : Apprentice Miner
1

Create an account or sign in to comment.

3

1
11/11/2015 12:11 pm
Level 7 : Apprentice Network
TomPoTheGamer
TomPoTheGamer's Avatar
Try this out:


@EventHandler
public void onPlayerJoin(PlayerJoinEvent e){
Player p = e.getPlayer();

p.sendTitle("Top Text", "Bottom Text");
}
1
11/11/2015 9:08 am
Level 8 : Apprentice Miner
pieterx12
pieterx12's Avatar
Yeah but i'm going to run my server with custom plugins
1
11/11/2015 8:44 am
Level 24 : Expert Button Pusher
CoolLord22
CoolLord22's Avatar
Hey! I found a plugin that already does this. You can customize the join message. Let me know if this works for you! https://www.spigotmc.org/resources/titl ... sage.2173/
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome