The modding API for Stardew Valley.
Go to file
Zoryn Aaron 59a35d1112 readme 2016-02-28 20:29:43 -05:00
Release updates 2016-02-28 20:26:36 -05:00
StardewModdingAPI updates 2016-02-28 20:26:36 -05:00
.gitignore binaries 2016-02-28 16:15:53 -05:00
LICENSE Initial commit 2016-02-28 06:44:19 -05:00
README.md readme 2016-02-28 20:29:43 -05:00
StardewModdingAPI.sln no message 2016-02-28 06:55:35 -05:00
StardewModdingAPI.vssscc no message 2016-02-28 06:55:35 -05:00

README.md

SMAPI

A Modding API For Stardew Valley

You can create a mod by making a direct reference to the ModdingApi.exe

From there, you need to inherit from StardewModdingAPI.Mod

The first class that inherits from that class will be loaded into the game at runtime, and once the game fully initializes the mod, the method Entry() will be called once.

It is recommended to subscribe to an event (from Events.cs) to be able to interface with the game rather than directly make changes from the Entry() method.

TestMod.cs:

    public class TestMod : Mod
    {
        public override string Name
        {
            get { return "Test Mod"; }
        }

        public override string Authour
        {
            get { return "Zoryn Aaron"; }
        }

        public override string Version
        {
            get { return "0.0.1Test"; }
        }

        public override string Description
        {
            get { return "A Test Mod"; }
        }

        public override void Entry()
        {
            Console.WriteLine("Test Mod Has Loaded");
            Program.LogError("Test Mod can call to Program.cs in the API");
            Program.LogColour(ConsoleColor.Magenta, "Test Mod is just a tiny DLL file in AppData/Roaming/StardewValley/Mods");

            Events.GameLoaded += Events_GameLoaded;
        }

        void Events_GameLoaded()
        {
            
            Program.LogInfo("[Game Loaded Event] I can do things directly to the game now that I am certain it is loaded thanks to events.");
        }
    }