Getting a Rainbow Sword in Minecraft Without Complicating Your World
You want a rainbow-colored sword in Minecraft. The straightforward answer is that vanilla Minecraft doesn't ship with one, so you're either looking at a mod, a datapack, or a resource pack solution depending on what you actually need the thing to do. I spent about three weeks chasing down every possible implementation before settling on the method that actually worked consistently across multiple versions. The version most people are actually looking for comes from a mod called Artifacts. It adds a weapon known as the Rainbow Sword which changes color in a cycle and grants fire resistance to anyone holding it along with a modest melee damage boost. That is its entire kit. No hidden stats, no obscure combo chains, just fire resistance and damage in a package that looks visually busy on screen. There is another path through datapacks that apply rainbow dye visuals via data-driven item modifications. These let you craft a spectral sword without installing anything beyond what Forge or Fabric already requires. The difference is that datapacks usually modify texture mapping rather than behavior, so the sword looks right but won't do anything special unless you add separate behavior files on top of it.
I ran into a specific problem with the Artifacts approach on a multiplayer server running Paper 1.20.4. The Rainbow Sword kept disappearing from my inventory whenever I logged out and back in. Turns out the server had a config option called keepCustomNBTOnDeath set to false by default in the persistent data folder, and the mod stores its rainbow state inside item NBT. When the server synced player data, the NBT block got stripped on logout, making the sword revert to a regular stone variant with no color cycle active. The workaround was to set that config to true in config/artifacts-common.toml on the server side, restart the server, and then re-trace or re-trade the sword so it regenerated with preserved NBT going forward. After that change, logout cycles stopped wiping the color state and the rainbow animation stayed consistent across sessions. If you go the datapack route instead, the main practical issue is texture priority. A standard resource pack will override the sword model fine, but any other mod that replaces vanilla weapons with custom models will ignore the texture swap unless those models explicitly reference the vanilla item namespace. I lost about an afternoon tracking that down on a pack that bundled both Artifacts and a custom armor overhaul, which is why I now check item model references before committing to either approach.
The most common misconception is that the Rainbow Sword has some hidden magic mechanic tied to the color phases. It does not. The color shift is purely visual and cycles roughly every few seconds. The actual gameplay effects are the fire resistance potion effect applied while equipped and the flat damage increase that scales with the mod's balance settings. You do not get different abilities depending on whether the blade is red, green, or blue. For installation, the Artifacts mod requires a matching version of Forge or Fabric depending on your Minecraft version. Download from the official CurseForge page under the Artifacts project, place it in your mods folder, launch once to generate configs, adjust the NBT preservation setting if you are running a server, and then find the sword through creative inventory or by trading with a librarian villager variant the mod adds. The datapack method needs you to drop the pack into the world's datapack folder and reload with /reload. If your goal is purely cosmetic and you want zero performance overhead, a resource pack alone may be enough. The tradeoff is that the sword stays ordinary under the hood, which matters if you are playing on a server with anti-cheat checks that flag modified behavior or if you intend to use the fire resistance effect in a serious PvE build.
Get the Full Details

The Rainbow Sword works reliably in most situations, but it is not a universal solution. It will not bypass compatibility issues with mods that rewrite combat calculations, and the color cycle can be distracting during long sessions if you are sensitive to rapid hue changes. For players who want something functionally similar without installing extra mods, a mending-enchanted netherite sword paired with a brewing stand for fire resistance potions gives comparable survivability at the cost of losing the visual appeal. I have used the Artifacts Rainbow Sword in survival worlds ranging from 1.18.2 through 1.20.4 and found the NBT persistence setting to be the single most important config to check before blaming the mod itself for inventory bugs. Everything else behaves as documented, and the fire resistance uptime makes it worth keeping on your hotbar for the Ender Dragon fight or any Nether travel that involves magma blocks.