Skip to content

Instantly share code, notes, and snippets.

@Neverboosted
Created June 12, 2019 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neverboosted/79f548e902ff9f8e5c9c496ec8081d58 to your computer and use it in GitHub Desktop.
Save Neverboosted/79f548e902ff9f8e5c9c496ec8081d58 to your computer and use it in GitHub Desktop.
DelhomeCommand
package de.fly.main.commands;
import de.fly.main.Main;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class DelhomeCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(label.equalsIgnoreCase("delhome")){
if(sender instanceof Player){
Player p = (Player) sender;
if(args.length == 0){
p.sendMessage("§b[REDz] §cFalscher Syntax : §7/delhome (Name)");
return false;
}
if(args.length == 1){
if(Main.getInstance().getConfig().contains("home" + p.getUniqueId().toString() + "." + args[0])){
Main.getInstance().getConfig().set("home." + p.getUniqueId().toString() + "." + args[0], null);
p.sendMessage("§b[REDz] §7Der Home §e " + args[0] + "§7wurde gelöscht!" );
return false;
} else {
p.sendMessage("§b[REDz] §7 Der Home mit dem Namen §e " + args[0] + " §7 exsistiert nicht!");
return false;
}
}
if(args.length >= 2) {
p.sendMessage("§b[REDz] §cFalscher Syntax : §7/delhome (Name)");
return false;
}
}
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment