plugin.yml crashing my server

Discussion in 'Plugin Development' started by Zangoran, May 30, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Zangoran

    Ok I am having problems with my plugin.yml here is the crash report: http://pastebin.com/YFMSzgR7
    Here is my plugin.yml:
    Code:
    name: SMP
    main: me.zangoran.kobaltorange.smp.SMP
    version: 1.0
    author: Zangoran
     
    commands:
      smp:
        description: Kicks everyplayer when they join unless they have the smp.bypass permission!
        usage: "Error! Perhaps you meant /smp <command>"
        permission-message: "&kI&4[&6SMP&4]&2You do not have &6permission &4to do this! &c(&d<permission>&c)&kI"
     
    permissions:
      smp.*:
        description: Gives access to all commands
        children:
          smp.toggle: true
          smp.bypass: true
          smp.kickmsg: true
      smp.toggle:
        description: Allows you to toggle /smp on|off|status|reload
        default: op
      smp.bypass
        description: Allows you to not be kicked when smp is active
        default: op
    Here is my code:
    Code:java
    1. package me.zangoran.kobaltorange.smp;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandExecutor;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.craftbukkit.Main;
    9. import org.bukkit.entity.Player;
    10. import org.bukkit.plugin.java.JavaPlugin;
    11.  
    12. public class SMP extends JavaPlugin implements CommandExecutor {
    13. @SuppressWarnings("unused")
    14. private static Player player;
    15. private Main plugin;
    16. public static boolean state = false;
    17.  
    18. public SMP(Main plugin){
    19. this.plugin = plugin;
    20.  
    21. }
    22.  
    23. @Override
    24. public void onEnable(){
    25. getLogger().info("onEnable has been enabled!");
    26. }
    27. @Override
    28. public void onDisable(){
    29.  
    30. }
    31. @SuppressWarnings("null")
    32. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    33. Player player = null;
    34. if (cmd.getName().equalsIgnoreCase("smp") && sender instanceof Player){
    35.  
    36. if(!player.hasPermission("smp.toggle")){
    37. player.sendMessage(ChatColor.RED + "You are not allowed to perform this command.");
    38. return true;
    39. }
    40.  
    41.  
    42. else if (args.length > 0)
    43. {
    44. if (args[0].equalsIgnoreCase("on"))
    45. {
    46. SMP.state = true;
    47. for(Player player11 : ((CommandSender) plugin).getServer().getOnlinePlayers()){
    48. if(!player11.hasPermission("smp.bypass")){
    49. player11.kickPlayer("Server is under maintenance!");
    50. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.DARK_GREEN + " ON");
    51. return true;
    52. }
    53. else if (args[0].equalsIgnoreCase("off"))
    54. {
    55. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.RED + " OFF");
    56. return true;
    57. }
    58. else if (args[0].equalsIgnoreCase("reload"))
    59. {
    60. if (!(player11 instanceof Player)) {
    61.  
    62. this.reloadConfig();
    63. this.saveConfig();
    64. Bukkit.getLogger().info("[SMP] Config Reloaded! ");
    65.  
    66. return true;
    67. } else if (player11.hasPermission("promotion.reload")) {
    68.  
    69. this.reloadConfig();
    70. this.saveConfig();
    71. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED+ "]" + ChatColor.DARK_RED + " Config reloaded!");
    72. System.out.println(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED+ "]" + ChatColor.DARK_RED + " Config reloaded!");
    73. return true;
    74.  
    75. } else {
    76. return false;
    77.  
    78. }
    79. }
    80. else return false;
    81. }
    82. }
    83. else
    84. {
    85.  
    86. return true;
    87. }
    88. }
    89.  
    90. return true;
    91.  
    92. }
    93. return false;
    94. }
    95. }
    96.  
     
  2. Zangoran You missed a colon by 'smp.bypass'
     
  3. Offline

    Zangoran

    DJSkepter Wow I messed up a lot. Thanks!
     
  4. Zangoran No thanks needed, anyone could have made that mistake. You can test for errors in YAML files by pasting it into yaml-online-parser.appspot.com
     
  5. Offline

    Zangoran

  6. Zangoran Remove this:
    Code:java
    1. public SMP(Main plugin){
    2. this.plugin = plugin;
    3. }
     
    Zangoran likes this.
  7. Offline

    Zangoran

    DJSkepter THANKS, you fixed my problem. Thank you, thank you, and thank you!

    DJSkepter Ok so when I did /smp on this happened (below)

    Code:
    [15:39:42 INFO]: EpicZmanNinja issued server command: /smp on
    [15:39:42 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'smp' in plugin SMP v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4
    dcde-b3086jnks]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-
    1.7.9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:956) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bu
    kkit-1.7.9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:817) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R
    0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0
    .1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7
    .9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-
    2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4d
    cde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R
    0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
    Caused by: java.lang.NullPointerException
            at me.zangoran.kobaltorange.smp.SMP.onCommand(SMP.java:31) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4
    dcde-b3086jnks]
    Please help!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
    DJSkepter likes this.
  8. Zangoran Can you post your new code?
     
  9. Offline

    Zangoran

    DJSkepter
    Code:java
    1. package me.zangoran.kobaltorange.smp;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandExecutor;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.craftbukkit.Main;
    9. import org.bukkit.entity.Player;
    10. import org.bukkit.plugin.java.JavaPlugin;
    11.  
    12. public class SMP extends JavaPlugin implements CommandExecutor {
    13. @SuppressWarnings("unused")
    14. private static Player player;
    15. private Main plugin;
    16. public static boolean state = false;
    17.  
    18. @Override
    19. public void onEnable(){
    20. getLogger().info("onEnable has been enabled!");
    21. }
    22. @Override
    23. public void onDisable(){
    24.  
    25. }
    26. @SuppressWarnings("null")
    27. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    28. Player player = null;
    29. if (cmd.getName().equalsIgnoreCase("smp") && sender instanceof Player){
    30.  
    31. if(!player.hasPermission("smp.toggle")){
    32. player.sendMessage(ChatColor.RED + "You are not allowed to perform this command.");
    33. return true;
    34. }
    35.  
    36.  
    37. else if (args.length > 0)
    38. {
    39. if (args[0].equalsIgnoreCase("on"))
    40. {
    41. SMP.state = true;
    42. for(Player player11 : ((CommandSender) plugin).getServer().getOnlinePlayers()){
    43. if(!player11.hasPermission("smp.bypass")){
    44. player11.kickPlayer("Server is under maintenance!");
    45. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.DARK_GREEN + " ON");
    46. return true;
    47. }
    48. else if (args[0].equalsIgnoreCase("off"))
    49. {
    50. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.RED + " OFF");
    51. return true;
    52. }
    53. else if (args[0].equalsIgnoreCase("reload"))
    54. {
    55. if (!(player11 instanceof Player)) {
    56.  
    57. this.reloadConfig();
    58. this.saveConfig();
    59. Bukkit.getLogger().info("[SMP] Config Reloaded! ");
    60.  
    61. return true;
    62. } else if (player11.hasPermission("promotion.reload")) {
    63.  
    64. this.reloadConfig();
    65. this.saveConfig();
    66. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED+ "]" + ChatColor.DARK_RED + " Config reloaded!");
    67. System.out.println(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED+ "]" + ChatColor.DARK_RED + " Config reloaded!");
    68. return true;
    69.  
    70. } else {
    71. return false;
    72.  
    73. }
    74. }
    75. else return false;
    76. }
    77. }
    78. else
    79. {
    80.  
    81. return true;
    82. }
    83. }
    84.  
    85. return true;
    86.  
    87. }
    88. return false;
    89. }
    90. }
    91.  
     
  10. Zangoran Try this:
    Code:java
    1. package me.zangoran.kobaltorange.smp;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.plugin.java.JavaPlugin;
    9.  
    10. public class SMP extends JavaPlugin {
    11.  
    12. public static boolean state = false;
    13.  
    14. @Override
    15. public void onEnable() {
    16. getLogger().info("onEnable has been enabled!");
    17. }
    18.  
    19. @Override
    20. public void onDisable() {
    21. }
    22.  
    23. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    24. if (cmd.getName().equalsIgnoreCase("smp") && sender instanceof Player) {
    25. Player player = (Player) sender;
    26. if (!player.hasPermission("smp.toggle")) {
    27. player.sendMessage(ChatColor.RED + "You are not allowed to perform this command.");
    28. return true;
    29. } else if (args.length > 0) {
    30. if (args[0].equalsIgnoreCase("on")) {
    31. SMP.state = true;
    32. for (Player player11 : Bukkit.getServer().getOnlinePlayers()) {
    33. if (!player11.hasPermission("smp.bypass")) {
    34. player11.kickPlayer("Server is under maintenance!");
    35. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.DARK_GREEN + " ON");
    36. return true;
    37. } else if (args[0].equalsIgnoreCase("off")) {
    38. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.RED + " OFF");
    39. return true;
    40. } else if (args[0].equalsIgnoreCase("reload")) {
    41. if (!(player11 instanceof Player)) {
    42.  
    43. this.reloadConfig();
    44. this.saveConfig();
    45. Bukkit.getLogger().info("[SMP] Config Reloaded! ");
    46.  
    47. return true;
    48. } else if (player11.hasPermission("promotion.reload")) {
    49.  
    50. this.reloadConfig();
    51. this.saveConfig();
    52. player11.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.DARK_RED + " Config reloaded!");
    53. System.out.println(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.DARK_RED + " Config reloaded!");
    54. return true;
    55.  
    56. } else {
    57. return false;
    58.  
    59. }
    60. } else
    61. return false;
    62. }
    63. } else {
    64. return true;
    65. }
    66. }
    67. return true;
    68. }
    69. return false;
    70. }
    71. }
    72.  
     
  11. Offline

    Zangoran

  12. Offline

    WhatAaCow

    Zangoran after
    Code:java
    1. if (cmd.getName().equalsIgnoreCase("smp") && sender instanceof Player){
    you forgot to overgive the player into the player variable. So do:
    Code:java
    1. if (cmd.getName().equalsIgnoreCase("smp") && sender instanceof Player){ // here after this line
    2. player = (Player) sender;
     
  13. Offline

    Zangoran

    WhatAaCow
    DJSkepter Ok this is kinda dumb why does it say Error! Perhaps you meant /smp smp? When I do /smp on
    [​IMG]
     
  14. Zangoran Okay, try this: I completely fixed up everything which you kinda messed up :D
    Code:java
    1. package me.zangoran.kobaltorange.smp;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.plugin.java.JavaPlugin;
    9.  
    10. public class SMP extends JavaPlugin {
    11.  
    12. public static boolean state = false;
    13.  
    14. @Override
    15. public void onEnable() {
    16. getLogger().info("onEnable has been enabled!");
    17. }
    18.  
    19. @Override
    20. public void onDisable() {
    21. }
    22.  
    23. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    24. if (cmd.getName().equalsIgnoreCase("smp") && sender instanceof Player) {
    25. Player player = (Player) sender;
    26. if (!player.hasPermission("smp.toggle")) {
    27. player.sendMessage(ChatColor.RED + "You are not allowed to perform this command.");
    28. return true;
    29. } else if (args.length > 0) {
    30. if (args[0].equalsIgnoreCase("on")) {
    31. SMP.state = true;
    32. for (Player p : Bukkit.getServer().getOnlinePlayers()) {
    33. if (!p.hasPermission("smp.bypass")) {
    34. p.kickPlayer("Server is under maintenance!");
    35. p.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.DARK_GREEN + " ON");
    36. return true;
    37. }
    38. }
    39. } else if (args[0].equalsIgnoreCase("off")) {
    40. SMP.state = false;
    41. for (Player p : Bukkit.getServer().getOnlinePlayers()) {
    42. p.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.RED + " OFF");
    43. }
    44. return true;
    45. } else if (args[0].equalsIgnoreCase("reload")) {
    46. if (player.hasPermission("promotion.reload")) {
    47. this.reloadConfig();
    48. player.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.DARK_RED + " Config reloaded!");
    49. Bukkit.getLogger().info(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.DARK_RED + " Config reloaded!");
    50. return true;
    51. }
    52. } else {
    53. return false;
    54. }
    55. } else {
    56. return true;
    57. }
    58. }
    59. return true;
    60. }
    61. }
    62.  
     
  15. Offline

    Zangoran

    DJSkepter Why does it not say [SMP] SMP has been turned on when I do /smp on?
     
  16. Offline

    WhatAaCow

    Zangoran DJSkepter It doesn't says it because the statements are wrong in the code.
    Code:java
    1. if (!p.hasPermission("smp.bypass")) {
    2. p.kickPlayer("Server is under maintenance!"); // IF it kicks the player, he can't receive the message
    3. p.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.DARK_GREEN + " ON");
    4. return true;
    5. }
    So replace this with:
    Code:java
    1. if (!p.hasPermission("smp.bypass")) {
    2. p.kickPlayer("Server is under maintenance!");
    3. return true;
    4. } else {
    5. p.sendMessage(ChatColor.RED + "[" + ChatColor.GOLD + "SMP" + ChatColor.RED + "]" + ChatColor.BLUE + " SMP has been turned" + ChatColor.DARK_GREEN + " ON");
    6. }
     
    DJSkepter likes this.
  17. Offline

    Zangoran

    WhatAaCow Do you know why it is not doing [SMP] SMP has been turned off ?
     
  18. Offline

    WhatAaCow

    Zangoran There is no reason for not doing that
     
  19. Offline

    Zangoran

    WhatAaCow I want a way to turn off the auto kicking how do I do this?
     
  20. Offline

    WhatAaCow

    Zangoran What auto kicking? Do you mean the auto kicking when turning on the smp?
     
  21. Offline

    Zangoran

    WhatAaCow Yes

    WhatAaCow When I did /smp I got this
    Code:
    [16:33:51 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'smp' in plugin SMP v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4
    dcde-b3086jnks]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-
    1.7.9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:956) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bu
    kkit-1.7.9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:817) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R
    0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0
    .1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7
    .9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-
    2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4d
    cde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R
    0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
            at me.zangoran.kobaltorange.smp.SMP.onCommand(SMP.java:41) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4
    dcde-b3086jnks]
            ... 13 more
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
  22. Offline

    WhatAaCow

    Zangoran To auto kicking: Add another argument to the command and check if there are more then 1 args. If there are more, then don't auto kick all.

    Second: What is in line 41 in your SMP.java ?
     
  23. Offline

    Zangoran

    WhatAaCow At line 41: } else if (args[0].equalsIgnoreCase("off")) {

    And what is args

    and can you give me the code for the args thing?
     
  24. Offline

    WhatAaCow

    Zangoran Dude, please learn the basics of Java. I don't code your plugin ;)
     
  25. Offline

    Zangoran

    DJSkepter Do you know why it has a internal error when I do /smp ?
    Code:
    [17:12:55 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'smp' in plugin SMP v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4
    dcde-b3086jnks]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-
    1.7.9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:956) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bu
    kkit-1.7.9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:817) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R
    0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0
    .1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7
    .9-R0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-
    2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4d
    cde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R
    0.1-2-g1e4dcde-b3086jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.
    1-2-g1e4dcde-b3086jnks]
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
            at me.zangoran.kobaltorange.smp.SMP.onCommand(SMP.java:42) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.7.9-R0.2-20140520.082451-2.jar:git-Bukkit-1.7.9-R0.1-2-g1e4
    dcde-b3086jnks]
            ... 13 more
     
  26. Offline

    WhatAaCow

    Zangoran i think you tahgged the wrong...
     
  27. Offline

    JaguarJo

Thread Status:
Not open for further replies.

Share This Page