Advertisement
Guest User

Flying Feather

a guest
Mar 28th, 2015
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1.     public void hand(PlayerInteractEvent e) {
  2.         Player player = e.getPlayer();
  3.         if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  4.             if (player.getItemInHand() != null) {
  5.                 if(player.getItemInHand().getItemMeta().getDisplayName().equals(ChatColor.GOLD + "Feather of the gods")) {
  6.                     player.sendMessage(ChatColor.GOLD + "You feel the gods sending you power.");
  7.                     player.setAllowFlight(true);
  8.                     player.setFlying(true);
  9.                     player.getWorld().playSound(player.getLocation(), Sound.AMBIENCE_THUNDER, 1, 1);
  10.                 } else {
  11.                     player.setAllowFlight(false);
  12.                     player.setFlying(false);
  13.                 }
  14.             }
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement