Solved Breaking Blocks

Discussion in 'Plugin Development' started by TheAJ471, May 1, 2014.

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

    TheAJ471

    First of all, yes i do have this all set up the right way. I am just giving the event for you because it is easier.

    For some reason this doesnt work. i get no error on console and I am not sure what is wrong.

    Code:java
    1. @EventHandler
    2. public void onPlayerInteract(PlayerInteractEvent event) {
    3. Player p = event.getPlayer();
    4. Block b = event.getClickedBlock();
    5. if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
    6. if (b.equals(Material.BEDROCK)){
    7. p.sendMessage("Test!");
    8. }
    9. }
    10. }


    Thanks, TheAJ471
     
  2. Offline

    DxDy

    It's b.getType().equals(Material.BEDROCK)

    .equals on a Block and a Material will always return false ;)
     
    TheAJ471 likes this.
  3. Offline

    TheAJ471

Thread Status:
Not open for further replies.

Share This Page