PlayerInteractEvent (AIR) Not working

Discussion in 'Plugin Development' started by Maximvdw, Jan 25, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Maximvdw

    Dear,

    I'm experiencing problems with a plugin I just compiled for 1.7. The LEFT_CLICK_AIR and RIGHT_CLICK_AIR do not seem to work.

    I have made a simple listener to test this with another plugin:

    Action action = event.getAction(); // Get action
    Bukkit.broadcastMessage(action.name()); // Name

    When I right or left click the block it broadcasts the LEFT_CLICK_BLOCK and RIGHT_CLICK_BLOCK, but it doesn't show anything with air?

    Best Regards,
    Maximvdw
     
  2. Offline

    Skatedog27

    Solution:
    Code:java
    1. public void onPlayerInteract(PlayerInteractEvent event) {
    2. if (!e.getAction() == Action.RIGHT_CLICK_AIR) return;
    3. if (!e.getAction() == Action.LEFT_CLICK_AIR) return;
    4. Bukkit.broadcastMessage(ChatColor.BLUE + "YOU HAVE EITHER RIGHT CLICKED OR LEFT CLICKED AIR!!");
    5. }
     
Thread Status:
Not open for further replies.

Share This Page