I am adding a custom block which is quick sand i am using these block settings
public static final Block QUICKSAND = registerBlock("quicksand",
new Quicksand(FabricBlockSettings.create().mapColor(MapColor.PALE_YELLOW).strength(0.25f).sounds(BlockSoundGroup.SAND).dynamicBounds().solidBlock(Blocks::never).noCollision().blockVision(ModBlocks::always)));
and this is the code for when an entity collides with the block
public Quicksand(AbstractBlock.Settings settings) {
super(settings);
}
@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
entity.slowMovement(state, new Vec3d(0.1, 0.03f, 0.1));
if(entity instanceof LivingEntity) {
entity.damage(ModDamageTypes.of(world, ModDamageTypes.CUSTOM_DAMAGE_TYPE), 1.0f);
I tried using the .suffocates() but the .suffocates() is cancel with .noCollision() is there a way I can detect if the entity's/players is fully inside the block or the players head is inside it and then start dealing like how you wouldn't suffocate in quicksand unless your head is in it