Is this possible? [Disabling a modded feature]

I have this feature I would like to disable where sleeping in a bed will send someone to a modded dimension There is no config for that so is there any way to have something like the game being like "That person is in a bed but something is trying to send it somewhere so I will cancel that" or something like "This person is in the overworld and something is trying to take it somewhere but that player isn't in the nether. So I will cancel that."
Continue to help post