[RPG] the most effective way that a 20th level wizard can attempt to avoid demons or devils having access to the Material Plane

dnd-5eoptimization

Bob Bigson, 20th level Wizard, lives on the material plane. He wants to keep demons and devils from being able to enter the material plane, ever, full stop. Assuming he has whatever class abilities and even can lay his hands on whatever kind of magical item, what does Bigson need to do to achieve his goal? Any method that could result in demons and devils not appearing on the material plane is fine, Bob ain't picky.

This would normally be a 'DM thinks up a quest' moment, but after reading this question I'm interested in if there are RAW options that Bob could pursue to somehow achieve this goal without needing any DM intervention.

Best Answer

You would need to rewrite reality, or spend 2 trillion years (per world)

There are several ways you could approach this. None of them are easy. In fact, all approaches are nigh-impossible with crippling drawbacks which make them useless for practical applications. I'll get the simple one out of the way first.

Wish

Wish is on the Wizard spell list. You could wish that demons and devils will never enter the Material plane ever again. Alternatively, you might wish that demons and devils stop existing, which will also achieve the goal. This can work with a generous GM. But beware,

the greater the wish, the greater the likelihood that something goes wrong. This spell might simply fail, the effect you desire might only be partly achieved, or you might suffer some unforeseen consequence as a result of how you worded the wish.

Note that "some unforeseen consequence" in this scenario might involve the complete destruction of the Material Plane. Be careful what you wish for.

There is also the consideration that, if this task was as simple as casting a single standard spell, why hasn't anyone succeeded before?

Use Private Sanctum, Forbiddance and Hallow

This method is perhaps more in the spirit of the question. There are three spells I know of which could be used to stop fiends from entering the Material plane permanently in an area. Given sufficient time, and assuming nobody opposes you by casting dispel magic on any of the spells, your wizard could cover any arbitrarily large (finite) volume. The real trick is "sufficient time".

Private sanctum and forbiddance block planar travel completely. As demons and devils are native to planes other than the Material plane, they must perform planar travel to get here. Hallow can be used to specifically block fiends while still allowing planar travel for everyone else.

I'll note that the feasibility of this method hinges on a very strong assumption: that the "Material Plane" which Bob Bigson wants to protect is a finite number of worlds (ideally just one). If your definition of Material Plane includes every possible world in the multiverse (as alluded to in the Player's Handbook), or if you instead want to protect not just a planet but the entire infinite void of space, then you're out of luck.

But most mortal beings, even epic level characters, only ever see one world in the Material Plane. For the sake of a tractable computation, I'll assume that Bob Bigson is happy with protecting just his world on the Material Plane.

Mordenkainen's Private Sanctum

A 4th wizard spell which can be used to block planar travel within a 100-foot cube originating at a point within 120 feet of your wizard. Upcasting increases the size by 100 feet per level. It has a 10 minute casting time. If you cast it in the same spot every day for a year it becomes permanent.

There are two main advantages to this spell over the other options. Firstly, it is on the wizard spell list. Secondly, it can cover any volume in range, including floating in the air. As a bonus, it also does not have any costly material components.

Forbiddance

This 6th level cleric spell (which can be cast as a ritual) wards up to 40,000 square feet of floor space to a height of 30 feet above the floor against planar travel (that's 200 by 200 by 30 feet). It can also be made to damage fiends who enter and stay in it. If you cast it in the same place every day for 30 days, the spell lasts until dispelled, and it consumes 1000 gp of ruby dust.

While this is a pretty good spell, as we only care about blocking planar travel it is mostly inferior to private sanctum, besides requiring only a twelfth of the time to become permanent.

Hallow

This 5th level cleric spell affects an area with a radius of up to 60 feet from a point touched. It can be used to prevent fiends from entering the area. Hallow has a duration of Until Dispelled, not requiring multiple castings. Normally it has a casting time of 24 hours and costs 1000 gp of materials, but as it is not a wizard spell Bob Bigson will need to use wish to replicate it, subverting the casting time and material components.

This is exactly the effect we want, if only we could cover the whole Material plane with it. But there is a big caveat. Hallow does not work if its area overlaps another hallow spell. This is a problem, because it is not possible to pack non-overlapping spheres to fully cover an area.

(While I interpret hallow as being spherical, this is in dispute. Not that it helps you cover the sky, though.)

Note also that hallow targets a point touched. This means it cannot be placed in mid-air.

Strategy

A viable strategy would be to cast hallow over the solid surfaces of the world (using wish or a bunch of cleric friends), cast forbiddance in all the gaps between the hallow spells and cast private sanctum in the air where hallow and forbiddance cannot reach.

Let us estimate the time it would take for our lone wizard to achieve this feat. Let us assume the world is Earth-like. The Earth has a surface area of 510.1 million square kilometres, or about \$5.5\times10^{15}\$ square feet. Space is generally considered to begin at an altitude of 100 kilometres, or about 330,000 feet. This gives us a volume of about \$1.8\times10^{21}\$ cubic feet to ward. I haven't counted caves, but those would be counterbalanced by hills and mountains.

(For "space" to be a useful boundary, I assume that it is not viable for fiends to planar travel into the void of space then descend to the surface of your world. This may be due to how space works in your world or due to a limitation of demons and devils or creatures generically. If the demons and devils develop an interplanar space program you'll be out of luck, although when you're done the surface of your world will be utterly inhospitable to fiends so I don't know why they'd try.)

Most of this volume will need to be covered with private sanctum because it is in the air. You would need to be able to fly for most of it, which you could achieve by any number of means. A broom of flying or carpet of flying is probably the best means, as they grant flight for an unlimited duration. You will also require a necklace of adaptation to survive in high-altitude environments.

A 20th level wizard has three 4th level slots, three 5th level, two 6th level, two 7th level, one 8th level and one 9th level slot. We'll use that 9th level slot for casting wish to replicate hallow, and we'll use the remaining slots on private sanctum. If we have the Boon of High Magic and the Boon of Spell Recall, we could cast wish two additional times a day. Our wizard could also get two extra 5th level spell slots per day with Arcane Recovery.

Not using 9th level slots, a 20th level wizard could cover \$3\times 100^3 + (3+2)\times 200^3 + 2\times 300^3 + 2\times 400^3 + 1\times 500^3 = 3.5\times 10^8\$ cubic feet per year with private sanctum. This would take our lone wizard about five trillion years to cover the Earth up to space in private sanctum (that is, five million million, \$5\times10^{12}\$). Adding three 9th level slots gets us to \$10^9\$ cubic feet a year, which would take 1.8 trillion years instead. For reference, our Sun is expected to last only another 5 billion years before swallowing the Earth. The Earth would be long dead before you could completely block planar travel on the surface and the sky.

Of course, most of the trouble here comes from trying to fill the huge volume which is the sky. You have to do this, because many demons and devils can fly. You might get away with a lower altitude if demons and devils need to breathe, but that would not change the time by much.

Let us consider how long it would take to just cover the surface of the Earth. Dense circle packing has a roughly 90% efficiency. Hallow covers an area of \$\pi\times60^2=11,310\$ square feet. As such, it would take \$5.4\times10^{11}\$ castings of hallow to cover the Earth, which at three castings per day (from wish) is about 49 million years.

However, this does not account for the gaps. You could fill the gaps with forbiddance cast using wish, or with private sanctum. I'll consider forbiddance as we can shape the floor space covered to more optimally fill the gaps left by hallow, and it only takes 30 days to make permanent.

Forbiddance covers 40,000 square feet per casting. To cover the remaining \$5.5\times10^14\$ square feet will take \$1.375\times 10^{10}\$ separate castings, which at three per month is about 4 billion years. You can shave a couple billion years off this time by using hallow with a smaller radius to fill some of the gaps, but a precise calculation of such a recursive strategy is too complex to attempt here.

So technically, RAW, a 20th level wizard could ward a whole world against incursions from all fiends. But the time required to do it is so astronomical that there won't be a world left after you have finished the wards.

Also, to be absolutely sure...

The protection provided by private sanctum, hallow and forbiddance is fragile. Anyone on the Material plane could cast dispel magic on one of those wards, dispelling it and leaving a hole in your defences through which fiends could enter the Material plane.

To be absolutely sure that no fiends will ever be able to get onto the Material plane, you would also need to kill everyone capable of casting dispel magic and prevent anyone else from ever learning or casting dispel magic.

Of course, a lot can happen in 2 trillion years, so you probably won't need to do that step yourself.


Dishonourable Mention: Genocide

If somehow you could kill all demons and devils and prevent them from spawning, this would trivially achieve your wish to stop demons and devils from entering the Material plane.

However, the methods required to do so are beyond the "RAW options" scope of this question. But I'll give the main points anyway.

Depending on how the Lower Planes are structured in your multiverse, you may have an infinite number of demons. The Player's Handbook labels the Abyss as "The Infinite Layers of the Abyss". If there are an infinite number of layers, each occupied by demons, then there are an infinite number of demons, which means unless you can pull some fine cheese to produce an infinite number of soldiers you'll never be able to kill all the demons. However, the Dungeon Master's Guide says the Abyss has "virtually endless layers", implying that the number of layers is not literally infinite, so there may still be hope for this plan.

But probably harder than killing all the fiends (which is mostly a matter of grinding through combat encounters) is making sure no new fiends spawn. The standard D&D cosmology is belief-driven. As long as mortals still believe that Evil exists, fiends will probably appear somewhere to fill that void. The total eradication of Evil is not necessarily impossible (the conditions for destroying the book of vile darkness implies that it can be done), but is definitely beyond what can be achieved with options from the rulebooks.

Depending on your cosmology, devils and demons could be spawned from the souls of mortals who go to the Lower Planes when they die. If this is the case, then somehow stopping souls from going to the Lower Planes could prevent devils and demons from spawning. But again, there is no option in the rulebooks to achieve that.