Plugin not working and no errors?

Discussion in 'Spigot Plugin Development' started by ZevoGaems, May 6, 2017.

  1. ok I tried what you said but I am kind of confused. When I remove the casing from player it says I need to add cast to it and gives me an error. When I do e.setLoginResult(); what do I put inside of the of the ()? Here is the code I currently have.
    Code (Text):
        @EventHandler
        public void LogOnBanned(final AsyncPlayerPreLoginEvent e) {
            Player p = e.getPlayer();
            if(getConfig().getString("banned." + p.getUniqueId()) == null) {
                e.allow();
            } else {
                String reason2 = getConfig().getString("banned." + p.getUniqueId() + ".reason");
                String issuer2 = getConfig().getString("banned." + p.getUniqueId() + ".issuer");
                p.kickPlayer(ChatColor.GRAY + "Kicked whilst connecting: you are currently banned" + "\n"
                        + ChatColor.RED + "Banned by, " + issuer2 + "\n"
                            + ChatColor.RED + "Reason, " + reason2);
                e.setLoginResult(false);
            }
        }
     
  2. That's because there's no e.getPlayer() method, you should use methods such as e.getUniqueId() because as he didn't join yet, he's not yet a player.

    https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/AsyncPlayerPreLoginEvent.html
     
  3. Ok, I have
    Code (Text):
                e.disallow(null, ChatColor.GRAY + "Kicked whilst connecting: you are currently banned" + "\n"
                        + ChatColor.RED + "Banned by, " + issuer2 + "\n"
                            + ChatColor.RED + "Reason, " + reason2);
    but what would I put instead of null?
     
  4. WAS

    WAS

    Additionally, are you creating your plugin.yml and respective information regarding your plugin?
     
  5. Here just take a look at it
    Code (Text):
    main: pw.LoopTurn.punishment.main
    name: MineGridPunishments
    version: 1.0
    author: LoopTurn_
    description: MineGridPunishments

    commands:

        kick:
           description: Removes access to server from player
           usage: /<command>
        ban:
           description: Removes access to server from player
           usage: /<command>
         
    permissions:

        minegrid.kick:
            description: Gives approval to kick
            default: op
        minegrid.ban:
            description: Gives approval to ban
            default: op
           
    thats all I have
     
  6. WAS

    WAS

    Well it should still register but "author" should be "authors", and your values should be inside brackets. (I believe, at least. I did this once and my author came back null)

    Code (YAML):
    authors: [LoopTurn_]
    Or if there is more than one

    Code (YAML):
    authors: [LoopTurn_, WAS]
    I am not positive, but they may even be able to be strings (Citations needed)

    Possible fictional code
    Code (YAML):
    authors: ['LoopTurn_ (Main Author)', 'WAS (Contributor)']
    or maybe a string list? I dunno. Now I'm just curious. :p
    Code (YAML):
    authors:
    - 'LoopTurn_ (Lead Developer)'
     
  7. Can you please tell me just what to put in instead of null for the question I asked above I really need to fix this D: (Also I did what you said :p)
     
  8. Just Author is fine. Authors = list, there is no point of having a list with 1 string.

    @ZevoGaems Did you even read my previous post?

    #LookingForSpoonfeed
     
  9. I just did any none of it will fix my problem. I have checked everything and it seems to be right.
     
  10. That's not spoon-feed. The class is Result

    Use Result.KICK_BANNED or something (if you are using IDE press Ctrl+SPACE BAR and look for solutions)
     
  11. WAS

    WAS

    I must have had some other stray character in my path name or something to be getting that null I was getting than. Thanks.
     
  12. Ok so I changed all of it and for some reason it still isn't working. Here is my code
    Code (Text):
    package pw.LoopTurn.punishment;

    import java.util.UUID;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
    import org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result;
    import org.bukkit.plugin.java.JavaPlugin;

    public class main extends JavaPlugin implements Listener {
        public void onEnable() {
            Bukkit.getServer().getPluginManager().registerEvents(this, this);
            getConfig().options().copyDefaults(true);
            saveConfig();
        }

        @EventHandler
        public void LogOnBanned(final AsyncPlayerPreLoginEvent e) {
            UUID p = e.getUniqueId();
            if(getConfig().getString("banned." + p) == null) {
                e.allow();
            } else {
                String reason2 = getConfig().getString("banned." + p + ".reason");
                String issuer2 = getConfig().getString("banned." + p + ".issuer");
                e.disallow(Result.KICK_BANNED, ChatColor.GRAY + "Kicked whilst connecting: you are currently banned" + "\n"
                        + ChatColor.RED + "Banned by, " + issuer2 + "\n"
                            + ChatColor.RED + "Reason, " + reason2);
            }
        }

        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(cmd.getName().equalsIgnoreCase("kick")) {
                if(!sender.hasPermission("minegrid.kick")) {
                    sender.sendMessage(ChatColor.RED + "Requested Permission Level \n TRAINEE");
                }
                if(sender.hasPermission("minegrid.kick")) {
                    if(!(args.length > 1)) {
                        sender.sendMessage(ChatColor.RED + "Usgae, /kick (player) (reason)");
                    }
                    if(args.length > 1) {
                        String PName = args[0];
                        final Player target = Bukkit.getPlayerExact(PName);
                        if(target == null) {
                            sender.sendMessage(ChatColor.RED + "Error, player couldn't be identified");
                        }
                        if(target != null) {
                            StringBuilder message = new StringBuilder();

                            for (int i = 1; i < args.length; i++) {
                                message.append(args[i] + " ");
                            }
                             
                                target.kickPlayer(ChatColor.RED + "You have been kicked from the server" + "\n"
                                        + ChatColor.RED + "Kicked By: " + sender.getName() + "\n"
                                            + ChatColor.RED + "Reason: " + message);
                             
                                sender.sendMessage(ChatColor.RED + "You have kicked, " + target.getName() + " for, " + message);
                    }
                }
            }
        }    else if(cmd.getName().equalsIgnoreCase("ban")) {
            if(!sender.hasPermission("minegrid.ban")) {
                sender.sendMessage(ChatColor.RED + "Requested Permission Level \n MODERATOR");
            }
            if(sender.hasPermission("minegrid.ban")) {
                if(!(args.length > 1)) {
                    sender.sendMessage(ChatColor.RED + "Usgae, /ban (player) (reason)");
                }
                if(args.length > 1) {
                    String PName1 = args[0];
                    final Player target1 = Bukkit.getPlayerExact(PName1);
                    if(target1 == null) {
                        sender.sendMessage(ChatColor.RED + "Error, player couldn't be identified");
                    }
                    if(target1 != null) {
                        StringBuilder message1 = new StringBuilder();

                        for (int i = 1; i < args.length; i++) {
                            message1.append(args[i] + " ");
                        }
                         
                            target1.kickPlayer(ChatColor.WHITE + "Internal Exception: java.io.IOException: An existing connection was forcibly closed by remote host");
                            getConfig().set("banned." + target1.getUniqueId() + ".reason", message1);
                            getConfig().set("banned." + target1.getUniqueId() + ".issuer", sender.getName());
                            saveConfig();
                            reloadConfig();
                            sender.sendMessage(ChatColor.RED + "You have permanently banned, " + target1.getName() + " for, " + message1);
                }
            }
        }
    }
            return true;
    }
    }
    I have tried multiple things and I don't know what I am doing wrong! Please don't ask me to try things I have already tried unless there is actual reason it would work this time.
     
  13. One question the commands are working?

    Because you did not register the commands onEnable

     
    • Like Like x 1
  14. As long as I can remember if you develop the commands in the Main class you don't need to register them
     
  15. Hmmm, I had forgotten.:p
     
    • Funny Funny x 1
  16. Yes the commands are working :p
     
  17. Ok I have my plugin right here. I will give you the plugin.yml and the code and the consoles response when I try the command.

    main class (only class)
    Code (Text):
    package pw.LoopTurn.punishment;

    import java.util.UUID;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
    import org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result;
    import org.bukkit.plugin.java.JavaPlugin;

    public class main extends JavaPlugin implements Listener {
        public void onEnable() {
            Bukkit.getServer().getPluginManager().registerEvents(this, this);
            getConfig().options().copyDefaults(true);
            saveConfig();
        }

        @EventHandler
        public void LogOnBanned(final AsyncPlayerPreLoginEvent e) {
            UUID p = e.getUniqueId();
            if(getConfig().getString("banned." + p) == null) {
                e.allow();
            } else {
                String reason2 = getConfig().getString("banned." + p + ".reason");
                String issuer2 = getConfig().getString("banned." + p + ".issuer");
                e.disallow(Result.KICK_BANNED, ChatColor.GRAY + "Kicked whilst connecting: you are currently banned" + "\n"
                        + ChatColor.RED + "Banned by, " + issuer2 + "\n"
                            + ChatColor.RED + "Reason, " + reason2);
            }
        }

        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(cmd.getName().equalsIgnoreCase("kick")) {
                if(!sender.hasPermission("minegrid.kick")) {
                    sender.sendMessage(ChatColor.RED + "Requested Permission Level \n TRAINEE");
                }
                if(sender.hasPermission("minegrid.kick")) {
                    if(!(args.length > 1)) {
                        sender.sendMessage(ChatColor.RED + "Usgae, /kick (player) (reason)");
                    }
                    if(args.length > 1) {
                        String PName = args[0];
                        final Player target = Bukkit.getPlayerExact(PName);
                        if(target == null) {
                            sender.sendMessage(ChatColor.RED + "Error, player couldn't be identified");
                        }
                        if(target != null) {
                            StringBuilder message = new StringBuilder();

                            for (int i = 1; i < args.length; i++) {
                                message.append(args[i] + " ");
                            }
                           
                                target.kickPlayer(ChatColor.RED + "You have been kicked from the server" + "\n"
                                        + ChatColor.RED + "Kicked By: " + sender.getName() + "\n"
                                            + ChatColor.RED + "Reason: " + message);
                           
                                sender.sendMessage(ChatColor.RED + "You have kicked, " + target.getName() + " for, " + message);
                    }
                }
            }
        }    else if(cmd.getName().equalsIgnoreCase("ban")) {
            if(!sender.hasPermission("minegrid.ban")) {
                sender.sendMessage(ChatColor.RED + "Requested Permission Level \n MODERATOR");
            }
            if(sender.hasPermission("minegrid.ban")) {
                if(!(args.length > 1)) {
                    sender.sendMessage(ChatColor.RED + "Usgae, /ban (player) (reason)");
                }
                if(args.length > 1) {
                    String PName1 = args[0];
                    final Player target1 = Bukkit.getPlayerExact(PName1);
                    if(target1 == null) {
                        sender.sendMessage(ChatColor.RED + "Error, player couldn't be identified");
                    }
                    if(target1 != null) {
                        StringBuilder message1 = new StringBuilder();

                        for (int i = 1; i < args.length; i++) {
                            message1.append(args[i] + " ");
                        }
                       
                            target1.kickPlayer(ChatColor.WHITE + "Internal Exception: java.io.IOException: An existing connection was forcibly closed by remote host");
                            getConfig().set("banned." + target1.getUniqueId() + ".reason", message1);
                            getConfig().set("banned." + target1.getUniqueId() + ".issuer", sender.getName());
                            saveConfig();
                            reloadConfig();
                            sender.sendMessage(ChatColor.RED + "You have permanently banned, " + target1.getName() + " for, " + message1);
                }
            }
        }
    }
            return true;
    }
    }
    plugin.yml

    Code (Text):
    main: pw.LoopTurn.punishment.main
    name: MineGridPunishments
    version: 1.0
    authors: [LoopTurn_]
    description: MineGridPunishments

    commands:

        kick:
           description: Removes access to server from player
           usage: /<command>
        ban:
           description: Removes access to server from player
           usage: /<command>
           
    permissions:

        minegrid.kick:
            description: Gives approval to kick
            default: op
        minegrid.ban:
            description: Gives approval to ban
            default: op
           
    Consoles Response to trying the command

    Code (Text):
    08.05 22:06:26 [Server] WARN handleDisconnection() called twice
    08.05 22:06:26 [Server] INFO ... 21 more
    08.05 22:06:26 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:54) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.Yaml.load(Yaml.java:369) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:450) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:127) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:141) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:489) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:354) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:147) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:373) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:489) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:354) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:147) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:373) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:489) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:354) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:147) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:373) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructUndefined.construct(SafeConstructor.java:505) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO ^
    08.05 22:06:26 [Server] INFO reason: !!java.lang.StringBuilder {}
    08.05 22:06:26 [Server] INFO in 'string', line 3, column 13:
    08.05 22:06:26 [Server] INFO Caused by: org.yaml.snakeyaml.constructor.ConstructorException: could not determine a constructor for the tag tag:yaml.org,2002:java.lang.StringBuilder
    08.05 22:06:26 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:574) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:675) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:739) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_111]
    08.05 22:06:26 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_111]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1179) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerConnection.java:1344) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:650) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at pw.LoopTurn.punishment.main.onCommand(main.java:92) [MineGridPunishments.jar:?]
    08.05 22:06:26 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:167) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:179) [spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:130) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:184) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:56) ~[spigot-1.11.2.jar:git-Spigot-b32c8f8-46226d6]
    08.05 22:06:26 [Server] INFO ^
    08.05 22:06:26 [Server] INFO reason: !!java.lang.StringBuilder {}
    08.05 22:06:26 [Server] INFO in 'string', line 3, column 13:
    08.05 22:06:26 [Server] INFO org.bukkit.configuration.InvalidConfigurationException: could not determine a constructor for the tag tag:yaml.org,2002:java.lang.StringBuilder
    08.05 22:06:26 [Server] ERROR Cannot load plugins/MineGridPunishments/config.yml
    08.05 22:06:26 [Server] INFO LoopTurn_
    08.05 22:06:26 [Disconnect] User LoopTurn_ has disconnected, reason: Internal Exception: java.io.IOException: An existing connection was forcibly closed by remote host
    08.05 22:06:26 [Server] INFO LoopTurn_ issued server command: /ban LoopTurn_ test
    The way I have the plugin setup
    http://imgur.com/a/mcYhI
     
  18. The error is pretty self-explanatory, there is something wrong in your config file.
     
  19. Can you tell me what the error is?
     
  20. Change

    getConfig().set("banned." + target1.getUniqueId() + ".reason", message1);

    to

    getConfig().set("banned." + target1.getUniqueId() + ".reason", message1.toString());

    message1 is a StringBuilder, so you're trying to store the StringBuilder rather then the result of the StringBuilder..
    (That's also the cause of your error)

    Also change
    if(getConfig().getString("banned." + p) == null) {

    to use getConfigurationSection, "banned.p" is of course going to be null because you have nothing at.

    banned:
    uuid: here

    instead you have

    banned:
    uuid:
    reason: lala

    And get rid of the e.allow (Otherwise your preventing other plugins from allowing that called before), using ! to flip the result of the getConfigurationSection and disallow on that.

    if(!getconfigsection == null){
    cancel
    }

    Your code formatting is also very wrong, your brackets are not aligned correctly and LogOnBanned should be onAsyncPlayerLoginBanned, use camelCase. I suggest you do a bit of research into Java basics on formatting of code as it will make it a lot easier to understand.