(I'm not sure if this is the ideal solution but it works)
Create the file src/main/resources/{MOD_ID}.accesswidener
(replace {MOD_ID} with your mod id) containing this:
accessWidener v1 named
accessible method net/minecraft/client/gui/screen/Screen addDrawableChild (Lnet/minecraft/client/gui/Element;)Lnet/minecraft/client/gui/Element;