ITT: My idea is to add a metadata tag for blocks that disables mob spawning and have beacons set this tag in their area of effect.
Firstly, let me start by saying why this feature is needed.
Later in the game, building bases that are mob-spawn-proof is closoe to impossible. Often design of bases suffers because of the forced selection of a small pool of blocks that either emit light or are mob-spawn-proof (Where choosing for the former also impacts the design of a base). It is fairly obvious adding more light blocks doesn't solve the problem. Often, players just want a room where it is dark and still mob-spawn-proof.
Blocks should have a metadata tag that prevents mob spawning on top of them, just like slabs and other spawn-proof blocks.
My suggestion is: make beacons set the metadata tag described above for all blocks in a given area (the aoe of the beacon). This could either be something all beacons do, or a special effect that a beacon must be dedicated for. This makes it possible to make safe bases, where the limit of the design is now the builder's skill. I also think this feature would come in at a stage of the game where mobs spawning within a players babse becomes an annoyance while building. Again: this is not because the player cannot deal with the mobs, but because the player does not want to deal with mobs at all times, which forces the player to build a safe base (which forces the player into certain block choices).
If the beacon suggestion is not accepted, the metadata tag would still be a great addition in my opinion, as some servers can then have a plugin or datapack which makes it possible to set that tag for certain blocks.
Thank you for reading, any feedback is appreciated.
Ignoring the fact that metadata doesn't exist anymore as of 1.13 (every variant of a block is now a separate block, this means doubling the number of blocks in the game, which are only unlimited in theory as each one still uses resources), and "spawn-proof" blocks are only so because the mob spawning code requires that a block has a solid top surface, meaning that is is a full face at an integer y-coordinate, for a mob to be able to spawn on it (this is why mobs can spawn on upper slabs but not lower slabs).
Also, it would make far more sense to give beacons a bounding box which is checked when a mob spawns (if it is inside it can't spawn); any beacons in loaded chunks (or just within 128 blocks of a player) would add their bounding box to a global list which is used by mob spawning (having too many beacons in an area could cause lag due to having to check each one every time a mob attempts to spawn but the mob spawning code is horribly inefficient and could be massively optimized as it makes as many as 216,000 spawn attempts for all types of mobs per second - I decreased the idle tick time in a Superflat world unable to spawn any mobs by more than 5-fold by greatly slowing down the rate of spawn attempts (29,040 worst-case, and if the mob cap can't be kept at least 50% filled it is further reduced to 9,680, a reduction of over 95%), without noticeably impacting natural (normal) mob spawning; sure, mob farms are much less efficient (1/4 as fast per chunk, 1/12 if the cap can't be maintained) but does anybody really need 100,000(!) items per hour?).
Quick detail: bounding boxes could still intersect the spawning area around a player even when theyre outside the 128 block radius, so it would probably have to be the radius + euclidean(beacon, corner of bounding).
I did not play the game for a couple years, therefore didnt realize blocks did explicitly have metadata anymore. However, the F3 screen still shows some information about a block (snowy, for example). The 'spawnable' tag could still be a part of this.
I like your bounding box more than the tag. However, I am still aware that the algorithm is not really made to deal with an area that simply disallows spawning (the lag issues you were talking about). Maybe the spawning algorithm should be changed to a more 'relaxed' approach, where the algorithm follows a curve of spawn tries per tick every time it fails (if it has succeeded before and needs to spawn something, try 30 times per tick, if it has failed spawning enemies like 500 times in a row, maybe only try to spawn stuff once every tick, of course with a minimum).
I would also like to get a reply from you about the idea of being able to basically turn off mob spawning within a bounding box at all. Are there any gameplay-related issues with this I am overseeing?
it would prevent animals from ruining your crop fields. Animals jumping on a wheat field can ruin them.
Animals only spawn on grass (with a few exceptions, like ocelots on leaves) and common sense is that you fence the fields in (I always put them inside my bases; example1, example2), or don't plant them next to a hill (aside from mobs that move by jumping mobs will only jump to get up or down a hill; just walking doesn't do any harm unless you are playing in Release 1.0 or earlier).