Started by
gustavowizard123
on
Topic category: Help with Minecraft modding (Java Edition)
When i put the this block, i want it to face the same side the block on Bottom of it is facing, so what should i change here:
Or could also make so it face the side its already facing, since its a tick update block - the top will replace the old top, facing the same side.
world.setBlockState(new BlockPos(i, j , k), mcreator_refrigeratorBottom.block.getDefaultState().withProperty(mcreator_refrigeratorBottom.block.FACING,entity.getHorizontalFacing().getOpposite()), 3);
the problem here is that the top turn into the other top, and face me, like when i put the block, i want, this time, it face the side it already was
So let me get this straight, you want a block to face the same side as the block on bottom?
https://mcreator.pylo.co/forum/31093/video-tutorial-how-make-rotatable-…
Nuparu made a video tutorial on how to place a block facing a certain direction when placed.
Now, since your block updates on tick, you want it to place the new block facing the same direction as the previous one? That is a bit tricky...
@#2 why is tricky? i just want it to face the same side as the previous one (yes on a tick);
BLOCKS: Coffe Machine OFF - Coffe Machine Running - Coffe Machine Done
ITEM: Coffe Machine, so when i click the OFF machine and make it run, it will remove the OFF block and Add teh Running one, when it does that, i code so it will face the player, the problem is that on the tick, if you move around, it will face you on the tick end, but if you get the Coffe item it will reset to the OFF state and will face the correct side again. The way is now is totally playable but not stetic nice yet. I think about changing the code when it ticks and add the running block, so again this part
world.setBlockState(new BlockPos(i, j , k), mcreator_refrigeratorBottom.block.getDefaultState().withProperty(mcreator_refrigeratorBottom.block.FACING,entity.getHorizontalFacing().getOpposite()), 3);
this .getOpposite does what? im very noob yet but think if you change something here and maybe on the blockstate file you can make it work.
getOpposite inverts the facing so if it value face to you and you want face it away from you , then you use this method.
We know what it is you want, it is tricky because that is easier said than done. The answer you seek is already in the thread I linked above, its just tedious and not too easy to follow for beginners. You just have to do some code and .json editing.
@#3 hum not oposite, i wanted it face the same side the last block was, if its that hard i guess i will leave this way for now, it will face the correct side and you if you click on it lol, im gonna upload my mod tomorrow, so prb its gonna be easier sice people can see all the code.