Guest User

Untitled

a guest
Jul 6th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. package de.lois.plugin.listener;
  2.  
  3. import de.lois.plugin.main.Main;
  4. import de.lois.plugin.menu.Menu;
  5. import org.bukkit.Material;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.event.EventHandler;
  8. import org.bukkit.event.Listener;
  9. import org.bukkit.event.block.Action;
  10. import org.bukkit.event.player.PlayerInteractEvent;
  11.  
  12.  
  13. public class InteractListener implements Listener {
  14.  
  15. @EventHandler
  16. public void onInteract(PlayerInteractEvent e){
  17. Player p = e.getPlayer();
  18. if(e.getItem().getType() == Material.COMPASS ) {
  19.  
  20. if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  21.  
  22. Menu menu = new Menu();
  23. menu.show(p);
  24.  
  25.  
  26. }
  27.  
  28. }
  29. }
  30. }
Add Comment
Please, Sign In to add comment