No reason to keep calling event.getEffect() here. Store event.getEffect() in a local variable, then use that in the MobEffect constructor.