Eruptive mass loss in massive stars is known to occur, but the mechanism(s) are not yet well understood. One proposed physical explanation appeals to opacity-driven super-Eddington luminosities in stellar envelopes. Here, we present a 1D model for eruptive mass loss and implement this model in the MESA stellar evolution code. The model identifies regions in the star where the energy associated with a local super-Eddington luminosity exceeds the binding energy of the overlaying envelope. The material above such regions is ejected from the star. Stars with initial masses of 10−100 M
⊙ at solar and SMC metallicities are evolved through core helium burning, with and without this new eruptive mass-loss scheme. We find that eruptive mass loss of up to ∼10−2
M
⊙yr−1 can be driven by this mechanism, and occurs in a vertical band on the H-R diagram between
3.5
≲
log
(
T
eff
/
K
)
≲
4.0
. This predicted eruptive mass loss prevents stars of initial masses ≳20 M
⊙ from evolving to become red supergiants (RSGs), with the stars instead ending their lives as blue supergiants, and offers a possible explanation for the observed lack of RSGs in that mass regime.