Warum geht der MSG CMD nicht?

  • Moin Moin,

    ich habe ein msg cmd gemacht doch warum auch immer wenn ich /MSG eingebe kommt dieser error:


    an internal error occurred while attempting to perform this command


    und in der console:


    [15:41:34 INFO]: MattisTube issued server command: /msg [15:41:34 ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'msg' in plugin LandPlugin v1.0.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-5f38d38-18fbb24] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-5f38d38-18fbb24] at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162) [spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997) [spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-5f38d38-18fbb24] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_101] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101] at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-5f38d38-18fbb24] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-5f38d38-18fbb24] at java.lang.Thread.run(Unknown Source) [?:1.8.0_101] Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at me.matti.commands.MSGCMD.onCommand(MSGCMD.java:30) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-5f38d38-18fbb24] ... 15 more




    MFG Matti

  • 1. Setz bitte den Fehler in die angebenen Code-Tags.

    2. Überprüfe bitte vor der Nachricht, ob der angebene Spieler online ist.

    3. Der Code message += args[1] + " "; müsste eigentlich so lauten message += args[i] + " ";, da du sonnst immer nur das 2. Argument (in Java 1) hinzufügst.

    4. Wieso castest du hier die Abfrage zum Player, wenn das ganze schon ein Player ist? Kann es sein, dass dort das null herkommt? Player target = (Player) Bukkit.getPlayer(args[0]);