Advertisement
pvpunikalnypvp

Untitled

Dec 20th, 2018
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1.  
  2.  
  3. import org.bukkit.Material;
  4. import org.bukkit.entity.Item;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.EventPriority;
  8. import org.bukkit.event.Listener;
  9. import org.bukkit.event.block.Action;
  10. import org.bukkit.event.player.PlayerInteractEvent;
  11.  
  12. public class LowienieListener implements Listener{
  13.  
  14. @EventHandler(priority=EventPriority.NORMAL)
  15. public void eggSprayEvent(PlayerInteractEvent e) {
  16. Player player = e.getPlayer();
  17. Material itemInHand = player.getInventory().getItemInHand().getType();
  18. Action action = e.getAction();
  19. if ((action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK)
  20. && itemInHand == Material.FISHING_ROD) {
  21. player.sendMessage("test");
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement