There's no direct cheat to spawn a unicorn. They're rare, magical creatures obtained through:
testingcheatsenabled true, then use forcetrait on parent horses to add "Unicorn" trait.Earning a unicorn legitimately is part of the fun—enjoy the journey!