Plugin category: EXAMPLE Suggested name: KickJoin What I want: I need a plugin where a player without the permissions Kick.Bypass when joining the sever will get kicked with a configurable message. If a player has the perm Kick.Bypass they will join the server normally. Ideas for commands: No commands needed for this plugin. Ideas for permissions: Kick.Bypass When I'd like it by: Anytime.
That would mean anyone who joins your server will be kicked without knowing their name to personally give them the rank Skript Code: on connect: player has permission "kick.bypass": stop else: kick the player due to "your message here" stop That simple
Ventality I can do it for you if you want. Lol, this is painful, but I can't get it work If you join the server, you get kicked on the first time with the right message, and then you get kicked with this: "Internal Exception: java.lang.ClassCastException: bju cannot be cast to fm." What the hell? Does someone know how fix this, timtower maybe?
timtower here: Code:java package de.mineteria.Lionhard98.KickOnJoin; import org.bukkit.ChatColor;import org.bukkit.Server;import org.bukkit.command.ConsoleCommandSender;import org.bukkit.entity.Player;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.player.PlayerJoinEvent;import org.bukkit.plugin.PluginDescriptionFile;import org.bukkit.plugin.PluginManager;import org.bukkit.plugin.java.JavaPlugin; public final class KickOnJoin extends JavaPlugin implements Listener { public static KickOnJoin plugin; public String getPluginPrefix(){ String prefix = "&b[&3Kick&bOn&3Join&b]"; return prefix; } public void onEnable(){ PluginDescriptionFile pluginYml = this.getDescription(); PluginManager pm = this.getServer().getPluginManager(); pm.registerEvents(this, this); Server server = this.getServer(); ConsoleCommandSender console = server.getConsoleSender(); console.sendMessage(getPluginPrefix() + ": " + ChatColor.DARK_AQUA + pluginYml.getName() + " v" + pluginYml.getVersion() + " has been enabled!"); } public void onDisable(){ PluginDescriptionFile pluginYml = this.getDescription(); Server server = this.getServer(); ConsoleCommandSender console = server.getConsoleSender(); console.sendMessage(getPluginPrefix() + ": " + ChatColor.DARK_AQUA + pluginYml.getName() + " v" + pluginYml.getVersion() + " has been disabled!"); } @EventHandler public void onPlayerJoin(PlayerJoinEvent event){ //Player player = event.getPlayer(); if(event.getPlayer() instanceof Player){ Player player = event.getPlayer(); if(!player.hasPermission(new Permissions().KickOnJoinBypass)){ Player[] allOnlinePlayers = this.getServer().getOnlinePlayers(); for(Player onlinePlayer : allOnlinePlayers){ if(onlinePlayer.hasPermission(new Permissions().KickOnJoinAdmin)){ onlinePlayer.sendMessage(ChatColor.translateAlternateColorCodes('&', getPluginPrefix() + ": " + this.getConfig().getString("inGameAdminNotification").replace("%player%", player.getName()))); } } //player.kickPlayer("test"); player.kickPlayer(ChatColor.translateAlternateColorCodes('&', this.getConfig().getString("kickMessage").replace("%player%", player.getName()))); } } }} I tried to google it, found just something about isntances so tried to check if the player is a instance of player, doesn't work either.
Hey i made the plugin for you: KickJoin.jar I will make a dev.bukkit.org page for it later Commands: /kickjoin info: display the plugin info. permission: None /kickjoin reload info: Reload the config file permission: kickjoin.reload Permission to join the server: kick.bypass EDIT: Now on Bukkit Dev: http://dev.bukkit.org/bukkit-plugins/kickjoin/
timtower I can change then the permission without having to search for the the code. (In this one it is not hard to find it, but in bigger projects I preffer the class, anyway, that isnt the problem )
http://dev.bukkit.org/bukkit-plugins/whitelist-message/ What's wrong with plugins that already exist? There are more than just the one linked above. Before you complain about it being for an old minecraft version, take the time to test it - many plugins of this nature aren't adversely affected by different MC versions.