Solved Stupid question... Why isn't this working?

Discussion in 'Plugin Development' started by HaitherecreeperMC, Nov 25, 2013.

Thread Status:
Not open for further replies.
  1. So I have this code:
    Code:java
    1. @EventHandler(priority = EventPriority.HIGHEST)
    2. public void onBlockClick(PlayerInteractEvent event){
    3. if(event.getAction() == Action.RIGHT_CLICK_BLOCK){
    4. Block block = event.getClickedBlock();
    5. if(block.getType() == Material.GRASS){
    6. Player p = event.getPlayer();
    7. p.sendMessage("LOL");
    8. getLogger().info("LOL");
    9. }
    10. }
    11. }

    And when I rightclick a grass block, nothing happens in the console and the player gets no messages? What am I doing wrong? My plugin's loading correctly... I've done this before, I know there's SOMETHING I'm stupidly missing.
     
  2. Offline

    mazentheamazin

  3. Offline

    Conarnar

    Did you register the listener?
     
  4. Main class.
     
  5. Offline

    mazentheamazin

  6. Hehe... Forgot that part, lol XD
    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page