Topic category: Help with Minecraft modding (Java Edition)
Hi everyone,
I'm trying to make a block however I require multiple collision/bounding boxes for it to work correctly. How do I add/override an extra box?
@Override
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) {
switch ((Direction) state.get(FACING)) {
case UP :
case DOWN :
case SOUTH :
default :
return VoxelShapes.create(1D, 0D, 0.5D, 0D, 1D, 0D);
case NORTH :
return VoxelShapes.create(0D, 0D, 0.5D, 1D, 1D, 1D);
case WEST :
return VoxelShapes.create(0.5D, 0D, 1D, 1D, 1D, 0D);
case EAST :
return VoxelShapes.create(0.5D, 0D, 0D, 0D, 1D, 1D);
}
}
This is basically a vertical slab, how do I add an extra cube beside it?
I am using version 1.14.4, but will be updating to 1.15+
Thanks
You could check out this tutorial:
https://mcreator.net/forum/65830/tutorial-making-non-cuboid-collision-boxes
Wow, thank you soo much it worked!
After editing values and for the collision box I managed to get it working the way I wanted it.
Really appreciate the help, I can finally finish my mod :)
TYSM!