Posted July 25, 20205 yr I created a custom model in blockbench and followed a tutorial on rotating the block to my face while placing but still it is not rotating to my face . My code is public class Half extends Block { private static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; private static final SoundType RS = SoundType.STONE; public Half() { super(Block.Properties.create(Material.IRON).harvestTool(ToolType.PICKAXE).harvestLevel(2).lightValue(15).hardnessAndResistance(2.0f, 2.0f).sound(RS)); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override public BlockState rotate(BlockState state, Rotation rot) { return state.with(FACING, rot.rotate(state.get(FACING))); } @Override public BlockState mirror(BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.toRotation(state.get(FACING))); } @Override protected void fillStateContainer(Builder<Block, BlockState> builder) { builder.add(FACING); } } any help to why is it not working ?
July 25, 20205 yr In the debug screen do you see your block has the facing property, and does it change every time you place it with different direction? If yes, have you rotate its models according to its state in your blockstate file?
July 25, 20205 yr Author 1 hour ago, poopoodice said: does it change every time you place it with different direction No, it doesnt change ,it is same no matter from wherever direction i place 1 hour ago, poopoodice said: If yes, have you rotate its models according to its state in your blockstate file? I have specified it in blockstate file .here see it { "variants":{ "facing=north": {"model": "hogwarts:block/half"}, "facing=south": { "model":"hogwarts:block/half", "Y" : 180}, "facing=west": { "model":"hogwarts:block/half", "Y" : 270}, "facing=east": { "model":"hogwarts:block/half", "Y" : 90} } } Now i cant undertand what do you mean by debug screen ?
July 25, 20205 yr Author Guys it was a small mistake in blockstate file i was extering 'Y' instead of 'y' that was causing problem ,now it's fixed. but there is one more thing i want to ask. see this image: You can see my block is rotating as i have created a semicircle but the problem now is if i want to rotate the block in such a way that a full circle can be made with it in above image. is there any way to do it or is there any vanilla block with this behaviour so i can copy its block state file .
July 25, 20205 yr 15 minutes ago, Harry12OK said: is there any vanilla block with this behaviour Stairs? It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.