Hello! I am quite stumped as I'm trying to set the block data given a string. I store an entire map in a text file with the block's state as a string (via block.getData().toString()), but now I'm trying to set that data. An example of the text data is this: Code: { x: -3.0, y: -3.0, z: -3.0, type: STAINED_CLAY, world: Urban, state: STAINED_CLAY(9) } { x: -3.0, y: -3.0, z: -2.0, type: STAINED_CLAY, world: Urban, state: STAINED_CLAY(9) } { x: -3.0, y: 1.0, z: -1.0, type: BRICK_STAIRS, world: Urban, state: BRICK_STAIRS(5) facing EAST inverted } { x: -3.0, y: 1.0, z: 0.0, type: BRICK_STAIRS, world: Urban, state: BRICK_STAIRS(5) facing EAST inverted } { x: -3.0, y: 1.0, z: 1.0, type: BRICK_STAIRS, world: Urban, state: BRICK_STAIRS(5) facing EAST inverted } { x: -3.0, y: 1.0, z: 2.0, type: BRICK_STAIRS, world: Urban, state: BRICK_STAIRS(5) facing EAST inverted } However, the function for setting the data of the block is deprecated and doesn't set the data properly (ex. clay isn't set to the correct color, stairs aren't updated properly, etc.). Is there a better way to do this? Code:java Location newLoc = blockLoc.add(loc); world.getBlockAt(newLoc).setType(block.getType()); MaterialData data = new MaterialData(block.getType()); for (byte byt : block.getBlockDataAsString().getBytes()) { data.setData(byt); } world.getBlockAt(newLoc).getState().setData(data); Original: Pasting the map: EDIT: I also logged the new and old block states stored in the text file. Code: [16:24:21 INFO]: Original: STAINED_CLAY(9) [16:24:21 INFO]: New: STAINED_CLAY(0) [16:24:21 INFO]: Original: AIR(0) [16:24:21 INFO]: New: AIR(0) [16:24:21 INFO]: Original: AIR(0) [16:24:21 INFO]: New: AIR(0) [16:24:21 INFO]: Original: AIR(0) [16:24:21 INFO]: New: AIR(0) [16:24:21 INFO]: Original: AIR(0) [16:24:21 INFO]: New: AIR(0) [16:24:21 INFO]: Original: AIR(0) [16:24:21 INFO]: New: AIR(0) [16:24:21 INFO]: Original: AIR(0) [16:24:21 INFO]: New: AIR(0) [16:24:21 INFO]: Original: AIR(0) [16:24:21 INFO]: New: AIR(0) [16:24:21 INFO]: Original: BRICK_STAIRS(2) facing NORTH [16:24:21 INFO]: New: BRICK_STAIRS(3) facing SOUTH As you can see, the block states are different. Code:java this.log("Original: " + block.getBlockDataAsString()); // Gets the data from the text file.this.log("New: " + world.getBlockAt(newLoc).getState().getData().toString());
@Xp10d3 setData isn't deprecated as far as the docs go. The issue could be that you aren't updating the block data after you set it. Try using blockState#update() and see if the issue persists. EDIT: Just remembered you're 1.8, so setData might be deprecated but should still work.