Last active
January 3, 2016 18:09
-
-
Save whilb/8500779 to your computer and use it in GitHub Desktop.
Example flight toggle command for bukkit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean onCommand(CommandSender sender1, Command cmd1, String label, String[] args) { | |
if(sender1 instanceof Player) { | |
Player p = (Player)sender; | |
if (CommandLabel.equalsIgnoreCase("fly")) { | |
if (!p.isFlying()) { | |
p.setFlying(true); | |
p.sendMessage(ChatColor.DARK_AQUA + "[Fly] " + ChatColor.YELLOW + "Flight mode enabled!"); | |
} else { | |
p.setFlying(false); | |
p.sendMessage(ChatColor.DARK_AQUA + "[Fly] " + ChatColor.YELLOW + "Flight mode disabled!"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment