Change block client side or bounding box

I’m trying to show a bounding box between two points when a player clicks on a certain block. I’ve come up with this code where i spawn in the world a structure block with the desired bounding box and then i send a client change to actually not showing the structure block but only the bounding box (not the cleanest of the solutions, i know…)

Location<World> location = player.getLocation();


TileEntity structureTileEntity = location.getTileEntity().get();

StructureData structureData = structureTileEntity.getOrCreate(StructureData.class).get();

structureData.set(structureData.size().set(new Vector3i(10, 10, 10)));

player.sendBlockChange(location.getBlockPosition(), BlockTypes.COBBLESTONE.getDefaultState()); // Should show client side a cobblestone block, not the structure block

However the last line doesn’t work, i expected to see a cobblestone block where the structure block is but instead i see the structure block. What am i missing in order to make this work? And also is there a proper way to show a bounding box? :slight_smile:

It all seems to be correct.
I would comment out the setting of the structure block and all the tile entity stuff and make sure that it is actually setting the block at your feet

make sure that it is actually setting the block at your feet

You mean the structure block or the fake cobblestone block? Because if you mean the cobblestone block i’ve already tried to do just that and it doesn’t work :confused:

Thats interesting then as I have used that function in the same way and works for me. Im not free to work on sponge until after the 3rd so ill be able to test your code and get it working then but until then i sadly can only do quick looks.