It looks like you are not correctly registering the capability. Add this:
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init);
to the constructor of your main mod class.
No. Do not conditionally register items. Do not do this.
There is a reason that the registry events run before the configuration events.
Do not do this.
Do not attempt to do this.
Do not.