use of net.md_5.bungee.api.chat.ClickEvent in project EliteMobs by MagmaGuy.
the class CommandsPage method commandsPage.
protected static TextComponent commandsPage() {
TextComponent textComponent = new TextComponent();
for (int i = 0; i < 13; i++) {
TextComponent line = new TextComponent(PlayerStatusMenuConfig.getCommandsTextLines()[i] + "\n");
if (!PlayerStatusMenuConfig.getCommandsHoverLines()[i].isEmpty())
PlayerStatusScreen.setHoverText(line, PlayerStatusMenuConfig.getCommandsHoverLines()[i]);
if (!PlayerStatusMenuConfig.getCommandsCommandLines()[i].isEmpty())
line.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, PlayerStatusMenuConfig.getCommandsCommandLines()[i]));
textComponent.addExtra(line);
}
return textComponent;
}
use of net.md_5.bungee.api.chat.ClickEvent in project EliteMobs by MagmaGuy.
the class CustomBossBossBar method sendLocation.
private void sendLocation() {
for (Player player : Bukkit.getOnlinePlayers()) {
if (!player.getWorld().equals(customBossEntity.getLocation().getWorld()))
continue;
TextComponent interactiveMessage = new TextComponent(MobCombatSettingsConfig.getBossLocationMessage());
interactiveMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/elitemobs trackcustomboss " + customBossEntity.getEliteUUID()));
interactiveMessage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(TranslationConfig.getTrackMessage().replace("$name", customBossEntity.getName())).create()));
player.spigot().sendMessage(interactiveMessage);
}
}
Aggregations