Hello, I'm making an auto-kick system for none-staff players, but got on this problem. If the system is activated, players will get kicked when they trigger the onjoin event and dont have a certain permission. The problem is, in chat it shows: Player left the game, Player joined the game, instead of join and then leave. They do get the kick message and a communication error, but when you press tab ingame with your staff account it still shows their name and counts them as online. Is there any way to fix this? Onjoin code: Code: @EventHandler public void onJoin(PlayerJoinEvent event) { getServer().getPluginManager().registerEvents(this, this); FileConfiguration config = getConfig(); Player player = (Player) event.getPlayer(); if(!(player.hasPermission("noentry.join"))) { String active = config.getString("NoEntry.Activated"); if(active=="Yes") { String type = config.getString("NoEntry.Type.Using"); String text = config.getString("NoEntry.Type."+type+""); player.kickPlayer(text); } } }
Yup, but the problem would be that it would show no message. And a part of the plugin is that it shows you a chosen message whenever it kicks somebody
Reteckz Use this: Code: event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Message here"); but you will have to use PlayerLoginEvent or use: Code: event.setJoinMessage("") on PlayerJoinEvent Hope this helps EDIT by Moderator: merged posts, please use the edit button instead of double posting.