Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ru.tanz.tlobby.command;
- import org.bukkit.Bukkit;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import ru.tanz.tlobby.Main;
- public class SetHP implements CommandExecutor{
- private final Main plugin;
- public SetHP(Main plugin) {
- this.plugin = plugin;
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (cmd.getName().equalsIgnoreCase("sethp")) {
- if (args.length <= 0) {
- sender.sendMessage(this.plugin.getConfig().getString("Messages.usage").replace("&", "§"));
- return false;
- } else {
- Player target = Bukkit.getPlayer(args[0]);
- if (target != null){
- if (target.isOnline()){
- this.plugin.uuid.add(target.getUniqueId());
- target.setMaxHealth(this.plugin.getConfig().getInt("SetHP.Health"));
- sender.sendMessage("§7Вы успешно установили количество §cсердец §7на " + args[0]);
- return true;
- } else {
- sender.sendMessage("§сИгрок не на сервере.");
- return false;
- }
- } else {
- sender.sendMessage("null");
- return false;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement