Guest User

Untitled

a guest
Aug 2nd, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. package me.phuoc;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. import net.md_5.bungee.api.ChatColor;
  10.  
  11. public class PluginFly extends JavaPlugin {
  12.  
  13. public void onEnable() {
  14. Bukkit.getServer().getLogger().info("Plugin Da Hoat Dong!");
  15. }
  16. public void onDisable() {
  17. Bukkit.getServer().getLogger().info("Plugin Da ngung Hoat Dong!");
  18. }
  19.  
  20. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
  21.  
  22. if (!(sender instanceof Player)) {
  23. sender.sendMessage(ChatColor.RED + "The Console Cannot use Medic!");
  24. return true;
  25. }
  26.  
  27. Player player = (Player) sender;
  28.  
  29. if (cmd.getName().equalsIgnoreCase("fly")) {
  30. if (args.length == 0) {
  31. player.setFlying(isEnabled());
  32. player.sendMessage(ChatColor.GREEN + "Bạn Đã Bật Fly!");
  33. return true;
  34. }
  35. Player target = Bukkit.getServer().getPlayer(args[0]);
  36. if (target == null) {
  37. player.sendMessage(ChatColor.RED + "Người Chơi Không Tồn Tại!");
  38. return true;
  39. }
  40. }
  41. return false;
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment