For example, naming yourself will mean that whenever the game references your name you'll receive a Legend fish, Treasure Chest, and Stardrop in your inventory which can be sold for 5,000g, 5,000g, and 7,777g respectively, although the Stardrop is often consumed automatically rather than remaining in your inventory to sell.
When it comes to Stardew Valley cheats, this is the big one! Every item in the game has a unique numerical code, and by using up to three of these codes each in as your character name, you'll spawn those items in your inventory every time your name is mentioned in the game.