Minecraft Plugin Fehler?

Hallo! Ich arbeite momentan an einem Plugin und habe gerade ein Problem welches ich nicht verstehe .... ich wollte einen /heal Befehl machen aber in Der Kosole erscheint Folgender Fehler:

null
org.bukkit.command.CommandException: Unhandled exception executing command 'heal' in plugin CityBuild-System v1.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1399) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1234) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_251]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_251]
        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at de.increase.citybuild.commands.COMMAND_heal.onCommand(COMMAND_heal.java:18) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.12.2.jar:git-Spigot-dcd1643-e60fc34]

Hier ist mein Code:

https://hatebin.com/zvhreqjqzz

Java, Minecraft, Minecraft Server, Plug-in
Config.yml funktioniert nicht was tun?

Ich mache gerade ein /position command aber wenn ich versuche sachen in die config.yml einzutragen gibt es immer einen Error (beim ausführen vom Command kommt: An internal error occuruppted while attempting to perform this command).
Hier die Error message:

Hier der code (ich weis ein paar fehler sind dabei aber ich möchte erstmal schaffen etwas in die config.yml zu schreiben):

public class Position implements CommandExecutor {
    
    private Main plugin;
    
    @SuppressWarnings("deprecation")
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if(sender instanceof Player) {
            Player p = (Player) sender;
            if(args.length == 1) {
                
                String X = String.format("%.0f", p.getLocation().getX());
                String Y = String.format("%.0f", p.getLocation().getY());
                String Z = String.format("%.0f", p.getLocation().getZ());
                
                
                plugin.getConfig().set("Position.args", args[0]);
                plugin.getConfig().set("Position.x", X);
                plugin.getConfig().set("Position.y", Y);
                plugin.getConfig().set("Position.z", Z);
                plugin.saveConfig();
                
                
                TextComponent text = new TextComponent("§aPosition §6" + args[0] + "§a is set to ");
                TextComponent ende = new TextComponent(" §8» ");
                TextComponent tp = new TextComponent("§7move");
                TextComponent coordinates = new TextComponent(
                    "§7[§6X: " + "§6" + String.format("%.0f", p.getLocation().getX()) +
                    "§6 Y: " + String.format("%.0f", p.getLocation().getY()) +
                    "§6 Z: " + String.format("%.0f", p.getLocation().getZ()) + "§7]§6" );

                coordinates.setClickEvent(new ClickEvent(Action.COPY_TO_CLIPBOARD, X + " " + Y + " " + Z));
                coordinates.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
                    new ComponentBuilder("§7Click to copy coordinates").create()));
                
                
                    tp.setClickEvent(new ClickEvent(Action.RUN_COMMAND, "/tp " + p.getName() + " " + X + " " + Y + " " + Z));        
                    tp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
                        new ComponentBuilder("§7Click here to tp to §8" + args[0]).create()));
                
                
                p.spigot().sendMessage(text, coordinates , ende, tp);
                
                
                    } else
                        p.sendMessage("§cPlease use" + "§6 /position[p] <name> §7/§6 /positionlist[plist] <name>" + "§c!");
                        
        } else {
            sender.sendMessage("§cYou cant use this command in a §6" + sender.getName() + "§c! You need to be a p to use this command!");
        }
        return false;
    }
}
Config.yml funktioniert nicht was tun?
Computer, Programmieren, Coden, Minecraft, Plug-in, Minecraft plugin, BukkitSpigot, Minecraft Plugins programmieren

Meistgelesene Fragen zum Thema Plug-in