[WorldEdit] replacing all blocks inside a region

Discussion in 'Spigot Plugin Development' started by zDoeProgram, Apr 13, 2017.

  1. Hello, I'm making a plugin and I am wondering if I am able to set all blocks inside a custom region I've made into a specific block. I've been googling all day and could not find the awnser. I want all blocks inside my regions to be set to Stone every x amount of time.


    Regards
     
  2. Are you using the WorldEdit API with your plugin
     
  3. Yes, thats where im struggeling.

    I'm trying to get all the blocks inside the region and set all the blocks to stone.
     
  4. Is this for prison or something since there are amny plugins that does exactly this.
     
  5. Well, what you need to be able to do is get a list of all the blocks in that region, something worldguard doesn't do.

    What worldguard does do, is give you coordinates of that region (a block vector min and max). Each block vector is an x,y,z. You can then iterate through those coordinates between the min and the max and get whatever the block is at those coordinates, and set it to stone.