The item ID for Rabbit's Foot in Stardew Valley is:
The above cheat code applies to all platforms including PC/Mac (Steam), XBOX One, PS4 and the Nintendo Switch.
Spawning items in Stardew Valley is not done via commands, but rather through a cheat in which you must set your character's name, or the name of an animal, to the item code of the item you wish to spawn surrounded by [ and ].
To spawn this item using an animal's name, visit Marnie's Ranch, speak to Marnie and purchase an animal (we recommend a chicken as it is cheapest). Name the animal  and press OK. You will then receive the rabbit's foot item.
You can only set your character's name once, at the start of the game (when you create your world), for this reason we recommend you use the animal name method. If you do wish to use this method, first set your character's name to  when creating your save. Whenever you speak to a villager that says your name in dialogue (for example Gus at the Stardrop Saloon) you will be given the rabbit's foot item.
If you need more help with spawning rabbit's foot, we have a detailed guide on our blog - click here to visit that page.
The Rabbit's Foot can be obtained via a few methods. The first is as a rare drop from the Serpent (0.8%) which can be found in the Skull Cavern. The second is from the Travelling Cart (low chance for it to be an item for sale) for around 2,000 gold (1,695 to 2,825). The third is to gain sufficient friendship, luck and mood with a Rabbit at which point it may produce this item. Whilst the Rabbit's Foot isn't used to craft anything, or used for any quests, it is a desirable item as it is used in the Enchanter's Bundle, and also has a high sale price.
Some say it's lucky.