How to deny placing of blocks if chunk contains presure plate?

Discussion in 'BungeeCord Plugin Development' started by FroZenKeyboard, Apr 25, 2017.

  1. So i got this, in a blockplace event. But it doesn't work:

    Code (Text):
            Chunk chunk = e.getBlockPlaced().getLocation().getChunk();
            for(BlockState entity : chunk.getTileEntities()) {
                if(entity instanceof PressurePlate) {
                    PressurePlate plate = (PressurePlate)entity;
                        e.setCancelled(true);
                        e.getPlayer().sendMessage("§c§oYou can't build here!");