Hello!
So I've been trying to add stair-like collision to my block.
What I basically want is that the player should be able to go through the area that is marked red in the image:
I've looked around and tried to use addCollisionBoxesToList but that only made the player get stuck (Maybe because I used it wrong).
Here's what I tried with addCollisionBoxesToList:
@Override
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) {
double xPos = pos.getX(), yPos = pos.getY(), zPos = pos.getZ();
list.add(new AxisAlignedBB(xPos, yPos, zPos, xPos + 0.5F, yPos + 1.0F, zPos + 0.5F));
list.add(new AxisAlignedBB(xPos, yPos, zPos + 0.5F, xPos + 1.0F, yPos + 1.0F, zPos + 1.0F));
super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
Someone also said that I have to use collisionRayTrace but I have no idea how to use that method.
And looking at the stair code didn't help me either.
So yeah any help is welcome ^^