I was tampering around with the neutral mobs, like the Zombie pigman to see if you could really sleep without it saying: "You cannot sleep because there are monsters nearby".
And it was true, and then I made it angry. It killed me while I slept in a bed though, and then I attempted to recreate the scene... and it pushed me out of bed.
But for some reason, this time I could not leave the bed and I wasn't dead either. To quit, I needed to close the MC launcher.
Zombie pigmen seem to no longer do this, but Players can still sleep next to Zombie pigmen after aggravating them and waiting until they walk a little slower...
Is this a bug? Please let me know what you think;
A crash report was made, while this happened too:
Attachments
Comments


Please do not mark unreleased versions as affected.
You don't have access to them yet.

Please do not mark unreleased versions as affected.
You don't have access to them yet.

Please force a crash by pressing F3 + C
for 10 seconds while in-game and attach the crash report (minecraft/crash-reports/crash-<DATE>-client.txt) here.

Unfortunately, this bug is quite uncommon and is only happening in a specific world.
If I redo the scene on a completely new world (default or superflat), this does not occur anymore... however I found something related to it with the Zombie pigmen.
You can actually sleep in a bed whilst the zombie pigmen is semi-hostile; meaning you can sleep when he is almost becoming Neutral again... but I do not know how the previous bug occured? Quite uncommon.
Here is a recording, providing probably further detail: https://youtu.be/WOBlz33zzd4

Unable to reproduce in 20w10a.