Why is there so many mobs?

So I was playing a casual game of easy on Minecraft 1.14 and I have full enchanted diamond armor and diamond sword. The problem is whenever I go outside when its night time I usually get wayyy to many mobs. There's like 4 enderman,8 creepers, lots of zombies, and too many skeletons to count. I keep dying every night due to the mobs killing me. It takes around like 3 critical hits to finally kill a zombie and it takes 6 regular hits to kill the zombie without crits. Here's the thing I have sharpness 3. I really don't know whats going on, I don't think it should be like this. I have to constantly change to peaceful to not die every single time. You won't believe how many creeper explosions I've got in my farms. Idk if this is a regular thing because I recently got back into Minecraft and wanted to check it out, but please respond and tell me if there's something i'm doing wrong. Thanks

Stop spam-clicking. Spam-clicking essentially turns your damage off. Click the attack button once, let the cooldown timer fill back up (by default there should be some sort of sword-thing that appears on your cursor, but I think there's an option somewhere that moves the cooldown indicator to somewhere next to your hotbar), then click the attack button again.

As far as mob density goes, it's not really any more mobs than in 1.12 or earlier. It just seems like it because mojang significantly nerfed the failure rate.

As far as mob density goes, it's not really any more mobs than in 1.12 or earlier. It just seems like it because mojang significantly nerfed the failure rate.

This change made no difference because the game always tries to fill the mob cap, which only takes a couple seconds (in 1.6.4, where the cap was 79 due to erroneously using 256 instead of 289 as a divisor), and indeed, even after reducing the spawn attempts per chunk by a factor of 4 (1/4 of chunks can spawn mobs per spawn cycle) I saw no difference in how many mobs I killed per play session, 414 over about 3 hours last time, which is actually above average, around 350 per play session in an earlier world (I mainly made this change to reduce the time spent on spawn cycles as an optimization, though it also nerfs mob farms (which I highly dislike) by that much, since they do try to prevent the cap from being reached. See this reply I made for more information on why the success rate of spawn attempts doesn't matter in normal situations - even while flying around in Creative the game was still able to maintain the mob cap with my changes - the game only needs about 0.4% of spawn attempts to succeed to fill the mob cap in 1 second and over the average lifetime of a hostile mob (about 1 minute including a 30 second no-despawn period and randomly despawning afterwards) it performs over 1 million spawn attempts - 70 mobs is just 0.0065% of that).

I'm guessing that Mojang made some other change; there was some mention of mobs no longer spawning more often at lower elevations but that was never a thing, back to at least 1.6.4, for which I have extremely extensive knowledge of its code (the game used to(?) check the altitude at a given coordinate (or before 1.8, the top of the highest loaded chunk section) and use it to randomly choose a layer from that layer downwards, so the lower the surface was the higher the chance of mobs spawning on a given layer was, but otherwise the chance per layer was uniform (e.g. Superflat world = 4 layers deep = 25% chance per layer; normal sea level = 63 layers = 1.6% chance per layer, so the Superflat world sees 15.75 times the spawn rate per layer). Mobs spawning at the surface would have(?) a reduced chance due to sunlight reducing the spawn chance (using the raw sky light value, which is 15 in blocks with direct exposure to the sky, which halves the spawn rate, so the game used to(?) encourage mobs to spawn in areas with no sky light).

Of course, we'll have to see the actual code to see what really was changed (MCP hasn't even been released for 1.13 yet, not that I could even use it since newer versions need more memory than I can allocate to decompile) but I can say that there are no more mobs than before throughout the world unless Mojang changed the mob cap (F3 should show a difference of about 70 when you switch to/from Peaceful, although this isn't 100% reliable since the server doesn't send most entities to the client (including singleplayer) unless they are less than 80 blocks away, for example, this screenshot says there are 51 mobs, all hostile, but MCEdit shows more).

Stop spam-clicking. Spam-clicking essentially turns your damage off. Click the attack button once, let the cooldown timer fill back up (by default there should be some sort of sword-thing that appears on your cursor, but I think there's an option somewhere that moves the cooldown indicator to somewhere next to your hotbar), then click the attack button again.

As far as mob density goes, it's not really any more mobs than in 1.12 or earlier. It just seems like it because mojang significantly nerfed the failure rate.

I've read about this cooldown timer so often and therefore make an effort not to spam-click. However, I never could spot a cooldown indicator on my screen (MC versions 1.12, 1.13 and now 1.14). I went searching in the settings for an option to turn it on, but couldn't find that either. What am I overlooking?

Well, I for one have completely failed to notice that there was a cooldown timer at all.

Now that I'm looking for it I can see it, it's a small stylized sword that pops up under the cross hair when you attack, turns whiter from left to right as it recharges and then disappears, see picture.

Different weapons have different cool down times. An axe does a lot of damage but has a long cooldown, a sword has a shorter cooldown. It was added to try to alleviate spam clicking, especially in PvP where essentially the player with the lower ping wins. Some people like it, but quite a few don't. There was a message from Dinnerbone I think that said he was going to look into changing it. So maybe next update or two there will be a new system.

Oh forgot one thing. I was going to say this but forgot. Whenever I go around 20-30 blocks away mobs will spawn next to my house or either somewhere else. One more thing i forgot to point out is that i changed from 1.13.2 to 1.14 but in 13.2 it still was happening.I will try to post a screenshot of the mobs all round my house. Oh another point is I don't usually put torches around my house because I'm trying to farm some of the loot from them. I will make a mob spawner soon when I got the time

Oh forgot one thing. I was going to say this but forgot. Whenever I go around 20-30 blocks away mobs will spawn next to my house or either somewhere else. One more thing i forgot to point out is that i changed from 1.13.2 to 1.14 but in 13.2 it still was happening.I will try to post a screenshot of the mobs all round my house. Oh another point is I don't usually put torches around my house because I'm trying to farm some of the loot from them. I will make a mob spawner soon when I got the time

Mobs can spawn outside of a sphere with a radius of 24 blocks around the player, so this would explain why they spawn when 20-30 blocks away, and you need to light up the area; also, you didn't happen to light up caves around the area? That will force mobs to spawn on the surface and in much higher numbers than you might think (as mentioned before, the mob spawning algorithm reduces spawn rates in areas with sky light); the surfaces of my worlds are crawling with mobs at night since I light up nearly all the caves everywhere (here is an extreme example of what happens when mobs are forced to spawn in a small area, in this case, a large cave that I explored after lighting up surrounding areas. The rate of mobs noticeably waxed and waned over periods corresponding to day/night cycles); similarly, hundreds of ocelots spawn in jungles during the day (they are included in the hostile mob spawn list but are passive mobs; the only saving grace is that they despawn and have a very low spawn weight).