5th-level transmutation
Casting Time: 1 minute
Range: 10 feet
Components: V, S, M
Duration: 8 hours

You judiciously sprinkle pixie dust over all of the objects and blow the whistle. Choose a pile or collection of at least 10 of the same Tiny object (such as a pile of bones, collection of the same toy, a stack of coins, or shelf of books) within range. The objects become a single Medium or Small swarm under your control until the spell ends or the swarm drops to 0 hit points. (The GM has game statistics for this swarm.)

As a bonus action on each of your turns, you can mentally command any swarm you animated with this spell if the creature is within 120 feet of you (if you control multiple swarms created y this spell, you can command any or all of them at the same time, issuing the same command to each one). You decide what action the swarm will take and where it will move during its next turn, or you can issue a general command, such as to guard a particular chamber or corridor. If you issue no commands, the swarm only defends itself against hostile creatures. Once given an order, the swarm continues to follow it until its task is complete.

When the swarm drops to 0 hit points, its components revert to their original forms. Any remaining damage may carry over to that form, at DM discretion.

At Higher Levels. When you cast this spell using a spell slot of 6th level or higher, you can either animate an additional object pile or collection for each slot level above 5th, or animate more objects to increase the swarm’s size for every two slot levels above 5th.