In order to be a perfect blackbody an object must be opaque (optically thick) to radiation at all wavelengths.
If you hypothesise a material that only absorbs/emits at discrete wavelengths then this can never emit a blackbody spectrum since there is no mechanism to emit radiation outside of those discrete lines.
In practice of course, atomic hydrogen gas at any non-zero temperature will have some opacity at all wavelengths - for example there is a non-zero probability of any atom becoming ionised and then there is a possibility of recombination radiation when a free electron combines with a hydrogen atom to form an H$^{-}$ ion$^{\dagger}$ or bremsstrahlung if it accelerates in the electric field of a proton. The inverse processes provides continuum opacity. Or, a tiny, but non-zero opacity is provided by the wings of the atomic transition lines - either because of natural line broadening or Doppler and pressure broadening. Whether these could result in blackbody radiation would depend on whether the hydrogen was physically thick and dense enough to be optically thick at all relevant wavelengths.
$\dagger$ This mechanism and its reverse is largely responsible for the continuum opacity in the solar photosphere and why the Sun's spectrum can be approximated (rather poorly actually) as a blackbody spectrum.