How to optimize this HritikRC minecraft's like my own bad block placement function minecraft?

hi, could you elaborate on “The block placement function cant make the player build their own house.” is it related to not being able to stack the boxes on top of each other and/or snapping them to one another, or a different issue?

If it is about box placement, I ran into a similar issue. I might be able to point you in the right direction. You can use raycasting to determine the placement position based on the intersected object. Take a look at the examples here: three.js examples but in particular, this one that uses box placement like in minecraft voxel painter.

I also found some minecraft-like repositories that might help you. This one seems simple enough to implement GitHub - vyse12138/minecraft-threejs: Minecraft clone made with three.js, demo: https://mc.yulei.me
and this one is more robust than the other one, but it seems to have better support GitHub - KairuiLiu/ThreeCraft: ⛏ MineCraft release based on three.js