Frage von dominisac12, 14

Java,BUkkit Wo liegt der Fehler?

org.bukkit.command.CommandException: Unhandled exception executing command 'newcommand' in plugin Manicraft v1.0.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit.jar:git-Spigot-e000104-4cb3258] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[craftbukkit.jar:git-Spigot-e000104-4cb3258] at org.bukkit.craftbukkit.v1_9_R1.CraftServer.dispatchCommand(CraftServer.java:645) ~[craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.PlayerConnection.handleCommand(PlayerConnection.java:1350) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:1185) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_101] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_101] at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:721) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [craftbukkit.jar:git-Spigot-e000104-4cb3258] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101] Caused by: java.lang.NullPointerException at de.max.cmds.cmd_newcommand.onCommand(cmd_newcommand.java:24) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit.jar:git-Spigot-e000104-4cb3258] ... 15 more

if(sender instanceof Player){ Player p = (Player)sender; double x = 1; double y = 1; double z = 1; x = p.getLocation().getX(); y = p.getLocation().getY(); z = p.getLocation().getZ(); plugin.getConfig().addDefault("Config.me", "hayt"); plugin. getConfig().addDefault("Lobby.x", "0"); plugin.getConfig().addDefault("Lobby.y", "0"); plugin.getConfig().addDefault("Lobby.z", "0"); plugin.getConfig().addDefault("Lobby.welt", "0"); plugin.getConfig().addDefault("Lobby.yaw","0") ; plugin.getConfig().addDefault("Lobby.pitch","0" ); plugin.getConfig().options().copyDefaults(true); plugin.getConfig().set("Lobby.x", x); plugin.getConfig().set("Lobby.y", y); plugin.getConfig().set("Lobby.z", z);

Antwort
von DexterNemrod, 11

Das ganze ist unmöglich zu lesen. Bitte verwende einen Pastingdienst wie http://hastebin.com oder https://gist.github.com um deinen code in lesbarer form online zu stellen.

So kann ich dir nur anhand der Fehlermeldung mitteilen, dass du in der Zeile 24 deiner newcommand.java versuchst, auf ein null Objekt zuzugreifen.

Kommentar von DennisReallife ,

Muss ich dir Recht geben.

Keine passende Antwort gefunden?

Fragen Sie die Community

Weitere Fragen mit Antworten