Unable to verify block material in BlockPlaceEvent

Discussion in 'Plugin Development' started by superpetguy1, May 20, 2019.

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


    Hello. I'm quite new to the bukkit development scene, but I decided to make a plugin that announces to the server when a TNT block is placed. The BlockPlaceEvent is triggered, but an if statement used to verify that the block is TNT wont.
        public void onPlace(BlockPlaceEvent event ) {
            Block block = event.getBlock();
            if(block.getState() instanceof TNT) {
                event.getPlayer().getServer().broadcastMessage(event.getPlayer().getDisplayName() + " just placed TNT!");
  2. Online

    timtower Moderator Moderator

Thread Status:
Not open for further replies.

Share This Page