Solved Noobish question... spawning blocks

Discussion in 'Spigot Plugin Development' started by Realm, Apr 28, 2017.

Thread Status:
Not open for further replies.
  1. I'm just not understanding why this isn't working the way I think it should:


    Code (Text):
        private void replaceBlock() {
            Bukkit.broadcastMessage("changed " + block.getType().name() + " to " + material.name());
            block.setType(material);
        }
    In game, if I break a diamond ore, it should replace that block to cobblestone.
    The debug message prints out:
    "changed DIAMOND_ORE to COBBLESTONE"
    but when I then call Block#setType it doesnt seem to update the block to cobblestone? ;/
    also no errors in console... idk what Im doing wrong, never had to spawn blocks using code before
     
  2. realised I had to cancel my event of breaking blocks, because apparantly the block break still goes through if you change the block type... anyway solved ;p
     
Thread Status:
Not open for further replies.