SHARE
TWEET

Untitled

a guest Nov 17th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     @Override
  2.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  3.  
  4.         if (cmd.getName().equalsIgnoreCase("setspawn")) {
  5.             if (sender instanceof Player) {
  6.                 Player p = (Player) sender;
  7.                 if (!p.hasPermission("spawn.set")) {
  8.                     p.sendMessage("§cDu hast dazu keine Rechte!");
  9.                 } else {
  10.                     Location loc = p.getLocation();
  11.                     getConfig().set("config.spawn.world", loc.getWorld().getName());
  12.                     getConfig().set("config.spawn.x", loc.getX());
  13.                     getConfig().set("config.spawn.y", loc.getY());
  14.                     getConfig().set("config.spawn.z", loc.getZ());
  15.                     getConfig().set("config.spawn.yaw", loc.getYaw());
  16.                     getConfig().set("config.spawn.pitch", loc.getPitch());
  17.                     saveConfig();
  18.                     p.sendMessage("§2Du hast erfolgreich den Spawn gesetzt!");
  19.                     Bukkit.getConsoleSender().sendMessage("[Spawn] Der Spieler " + p.getName() + " hat den Spawn gesetzt!");
  20.                 }
  21.             } else {
  22.                 sender.sendMessage("Dieser Befehl kann nur von einem Spieler ausgefuehrt werden!");
  23.             }
  24.         }
  25.         return true;
  26.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top