Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.phuoc;
- import org.bukkit.Bukkit;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- import net.md_5.bungee.api.ChatColor;
- public class PluginFly extends JavaPlugin {
- public void onEnable() {
- Bukkit.getServer().getLogger().info("Plugin Da Hoat Dong!");
- }
- public void onDisable() {
- Bukkit.getServer().getLogger().info("Plugin Da ngung Hoat Dong!");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
- if (!(sender instanceof Player)) {
- sender.sendMessage(ChatColor.RED + "The Console Cannot use Medic!");
- return true;
- }
- Player player = (Player) sender;
- if (cmd.getName().equalsIgnoreCase("fly")) {
- if (args.length == 0) {
- player.setFlying(isEnabled());
- player.sendMessage(ChatColor.GREEN + "Bạn Đã Bật Fly!");
- return true;
- }
- Player target = Bukkit.getServer().getPlayer(args[0]);
- if (target == null) {
- player.sendMessage(ChatColor.RED + "Người Chơi Không Tồn Tại!");
- return true;
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment