Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.lois.plugin.listener;
- import de.lois.plugin.main.Main;
- import de.lois.plugin.menu.Menu;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.player.PlayerInteractEvent;
- public class InteractListener implements Listener {
- @EventHandler
- public void onInteract(PlayerInteractEvent e){
- Player p = e.getPlayer();
- if(e.getItem().getType() == Material.COMPASS ) {
- if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
- Menu menu = new Menu();
- menu.show(p);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment