Advertisement
Guest User

Untitled

a guest
Mar 9th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. private Main main;
  2. public PluginListeners(Main plugin) {
  3. this.main = plugin;
  4. }
  5.  
  6. @SuppressWarnings({ "unlikely-arg-type", "deprecation" })
  7. @EventHandler
  8. public void onPhantom(PlayerInteractEvent e){
  9.  
  10. Player p = e.getPlayer();
  11. if(p.getItemInHand().getItemMeta().getDisplayName().equals("§bFLY")) {
  12. if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  13. p.sendMessage("fly");
  14. p.setAllowFlight(true);
  15. p.setFlying(true);
  16.  
  17. TimerTask task = new TimerTask();
  18. task.runTaskTimer(this.main, 0, 20);
  19.  
  20.  
  21.  
  22.  
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement