Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Main main;
- public PluginListeners(Main plugin) {
- this.main = plugin;
- }
- @SuppressWarnings({ "unlikely-arg-type", "deprecation" })
- @EventHandler
- public void onPhantom(PlayerInteractEvent e){
- Player p = e.getPlayer();
- if(p.getItemInHand().getItemMeta().getDisplayName().equals("§bFLY")) {
- if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
- p.sendMessage("fly");
- p.setAllowFlight(true);
- p.setFlying(true);
- TimerTask task = new TimerTask();
- task.runTaskTimer(this.main, 0, 20);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement