Log.Verbose("My First Mod Worked!");

using StardewModdingAPI;

using StardewValley;

StardewValley.Game1.getLocationFromName("farm")

Appendix 1: SMAPI Events



This is based on SMAPI 0.37.3 that I have the source here, maybe something is missing when compared to SMAPI 0.37.1



Events in SMAPI for now are grouped into types of events, they are:



Controls, Game, Graphics, Location, Menu, Player, Time



Game events



GameLoaded, no arguments



Happens after the game.exe is loaded in the memory



Initialize, no arguments



Happens while game.exe initializes XNA



LoadContent, no arguments



Happens after the game loaded all the xnb files, you can attempt to load stuff here, or edit things the game loaded, for example you can theoretically use RenderTarget to overwrite things in the game sprite sheets



UpdateTick, no arguments



Happens every frame after the game updated all the logic... Avoid using this please! If too many modders use this, the game will slow down! You have been warned!



Graphics



DrawTick, no arguments



Happens every frame, after the game drew its own things, like UpdateTick, please avoid abusing it, it might slow down the game, also be aware that anything you do will alter the game current rendered frame, so there is no way of using this to draw things "below" objects and UI, only "above", a good use for this is to make UI mods anyway, like the



Resize, same arguments as System.Windows.Forms.Form.Resize



Happens when the window is resized, useful if you for some reason need to always know the size of the window (for example if you are making some UI mod that resizes itself with the window).

Happens every frame, after the game drew its own things, like UpdateTick, please avoid abusing it, it might slow down the game, also be aware that anything you do will alter the game current rendered frame, so there is no way of using this to draw things "below" objects and UI, only "above", a good use for this is to make UI mods anyway, like the health bar mod Resize, same arguments as System.Windows.Forms.Form.ResizeHappens when the window is resized, useful if you for some reason need to always know the size of the window (for example if you are making some UI mod that resizes itself with the window).

Time



TimeOfDayChanged, (int32)PriorInt, (int32)NewInt



Happens when the current time changes, the number in PriorInt and NewInt is hhmm format, for example when the protagonist wakes up at 6:00 the game sets this variable to 600, and the game checks if this variable is bigger than 2000 to see if it is time for the dog to sleep.



InvokeDayOfMonthChanged, (int32)PriorInt, (int32)NewInt



Happens when the day of the month changes, at night, or if someone uses a cheat mod or debug to change this value manually. It is a good place to update things that happen at night, for example to make a



InvokeYearOfGameChanged, (int32)PriorInt, (int32)NewInt



Happens when the year changes.



InvokeSeasonOfYearChanged, (String)PriorString, (String)NewString



Happens when the month changes, due to quirks in Stardew Valley code, this is tracked by the season literal string name "Summer", "Fall", etc... so please, don't meddle with this, don't change the month name to "Verão" for example in an attempt to translate the game, it will break internal code.

Happens when the current time changes, the number in PriorInt and NewInt is hhmm format, for example when the protagonist wakes up at 6:00 the game sets this variable to 600, and the game checks if this variable is bigger than 2000 to see if it is time for the dog to sleep.Happens when the day of the month changes, at night, or if someone uses a cheat mod or debug to change this value manually. It is a good place to update things that happen at night, for example to make a sprinkler mod , numbers are the day of the monthHappens when the year changes.Happens when the month changes, due to quirks in Stardew Valley code, this is tracked by the season literal string name "Summer", "Fall", etc... so please, don't meddle with this, don't change the month name to "Verão" for example in an attempt to translate the game, it will break internal code.

Appendix 2: Some mod sources