Solved Stop this error!

Discussion in 'Spigot Plugin Development' started by TheFuzzyHead5, Apr 14, 2017.

Thread Status:
Not open for further replies.
  1. I have been messing around with this for some time now and it's painful.

    The PlayerInteractEvent, I'm trying to pick up what block the player clicks.

    I'm checking if

    e.getClickedBlock() != null
    e.getClickedBlock().getType() != null
    e.getClickedBlock().getType().equals(Material.GRASS)

    Somehow, the error is coming on the line checking if it is equal to grass. It is a NPE. How is this? I have checked if it is not equal to null! Also, for practise, out of the top two in bold, which should I use (if not both)?
     
Thread Status:
Not open for further replies.