Last night I was playing as my level 20 Barbarian, when our party encountered an enemy who was immune to all damage, unless it was of a specific elemental type.
This was particularly unfortunate for me, since my Barbarian deals exclusively in piercing and slashing damage. This resulted in me effectively standing around acting as a damage sponge while the party's spell-casters dealt all the damage.
While not a disastrous situation, it got me thinking:
Are there any ways to effectively change the type of damage I am dealing?
To be more specific, I am curious if there are any spells, enchantments, magics, magical weapons, etc which can change the type of damage a weapon's normal attack would have dealt. For example, my Barbarian's weapon deals slashing damage – I am wondering if there are ways to change the damage type into something else(eg into instead dealing fire or poison damage, or even piercing or bludgeoning).
I've read this similar question, but am playing 5e, not 3.5.
There are no weapons that just straight-up switch their damage type like that, and no spells or class abilities that can allow it.
There are weapons such as a Flame Tongue or Frost Brand which can deal additional elemental damage of a particular type. Then there are weapons like a Sun Blade which exclusively deals Radiant damage instead of Slashing damage.
As was mentioned in the comments, spells like Elemental Weapon or runes from Storm King's Thunder also exist...but they, likewise, supplement your damage, rather than entirely changing the type.
There is also the Sun Soul Monk, who can elect to trade out their Unarmed Strikes for energy blasts that deal Radiant Damage...but this is an alternate form of attack, not actually changing a weapon's damage type.
Ultimately, if you want a weapon that can change the sort of damage it deals, you're in homebrew territory.
There's nothing wrong with supplementing damage with an Elemental Type, rather than replacing it entirely. At least then you're doing something to contribute to the damage dealt. Perhaps carry extra gear that lets you nonmagically mimic elemental damage types, such as Alchemist's Fire, Acid Flasks, Poisons, etc.