Ask yourself if this sentence makes sense: “The density of this block is 6 g/ml(specifying magnitude) to the right(specifying direction).”
It does not make much sense to me.there is no need of specifying direction in it.density of a block is through out the block will be constant.
The other thing to think about, neither mass nor distance (remember - distance, not displacement) are vectors. Density is mass by volume. Volume is length×breadth×height. Wr know length,breadth,height, are scalars.
Since density is a derived measurement and since it is derived from all scalar measurements, density is a scalar measurement.