In 1.15+ it should work like this: (I'm uploading this just in case someone needs it)
@Override
public UseAction getUseAction(ItemStack stack) {
return UseAction.DRINK;
}
Here you have an example of how to use the Supplier<EffectInstance>
// (effect, duration 15 secs, level+), probability 1=100%
.effect(() -> new EffectInstance(Effects.NAUSEA, 10*20, 0), 0.7f)