Solved how to check if the block the player is breaking is a banner

Discussion in 'Spigot Plugin Development' started by craftmen0202, Sep 13, 2019.

  1. how to check if the block the player is breaking is a banner

    Code (Java):
    @EventHandler
        public void breakBandeira(BlockBreakEvent e) {
        if(Main.Partida) {
            Player p = e.getPlayer();
            Block block = e.getBlock();
            if (block.getType() == Material.BANNER) {
                p.sendMessage("ahahahahhaha");  
            }
        }
     
  2. Try changine "block.getType() == Material.BANNER" to:
    Code (Text):
    if(e.getBlock().getType().equals(Material.STANDING_BANNER) || e.getBlock().getType().equals(Material.WALL_BANNER)) {
    - Dagen from Gegobyte Developers