JoinMe

package byteventix.reports; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.HoverEvent; import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.plugin.Command; public class JoinMe extends Command { public static Main plugin; String pr = "§7[§9JoinMe§7] §7"; public JoinMe(Main pl) { super("joinme"); plugin = pl; } @SuppressWarnings("deprecation") public void execute(CommandSender cs, String[] args) { if ((cs instanceof ProxiedPlayer)) { ProxiedPlayer player = (ProxiedPlayer)cs; TextComponent clickto = new TextComponent("§aKlick um zu ihn zuspringen §8»"); clickto.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/server " + player.getServer().getInfo().getName())); clickto.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§7Springe zu §a" + player.getName()).create())); if(player.hasPermission("bungee.joinme")) { BungeeCord.getInstance().broadcast("§m§8--------------------------------------------"); BungeeCord.getInstance().broadcast(("§8" + player.getName() + " §aspielt §8" + player.getServer().getInfo().getName())); BungeeCord.getInstance().broadcast(clickto); BungeeCord.getInstance().broadcast("§m§8--------------------------------------------"); BungeeCord.getInstance().broadcast(""); } } } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.