Table of Contents

Class Mod

Tiny Life.dll

The base class for all Tiny Life mods. For an example mod, see Mods are uniquely identified by their ID. The id is the name of the class that extends Mod.

public abstract class Mod
Inherited Members
Extension Methods



The description of this mod, which will be visible in the options menu. To localize the description, use Localization.

public abstract string Description { get; }

Property Value



The icon texture region of this mod, which will be visible in the options menu

public virtual TextureRegion Icon { get; }

Property Value



An optional string that will be the destination of a clickable text in the main menu when this mod fails to initialize (Initialize(Logger, RawContentManager, RuntimeTexturePacker, ModInfo)) or add game content (AddGameContent(GameImpl, ModInfo)). Note that this will not be displayed when the mod fails to load entirely, since this class will not have had time to instantiate.

public virtual string IssueTrackerUrl { get; }

Property Value



The display name of this mod, which will be visible in the options menu

public abstract string Name { get; }

Property Value



Whether this mod requires Harmony for patches. If this is true, the HarmonyLib.Harmony instance to use can be found in Harmony during Initialize(Logger, RawContentManager, RuntimeTexturePacker, ModInfo). Note that Harmony is not currently supported on ARM devices like newer Macbooks. If you want to use Harmony only on certain devices, you can return a value based on IsOSPlatform(OSPlatform).

public virtual bool RequiresHarmony { get; }

Property Value



AddGameContent(GameImpl, ModInfo)

Add the content that this mod provides for the given GameImpl instance. Some of the supported things to register are: Register(TypeSettings) to register furniture types, Register(TypeSettings) to register action types, Register(Clothes) to register clothes (and hair), Register(SkillType) to register skills. Note that there are a lot of additional things that can be registered in this method.

public abstract void AddGameContent(GameImpl game, ModInfo info)


game GameImpl

The game instance.

info ModInfo

The ModInfo of this mod.


Return a list of paths (relative to this mod's Content directory) to textures that contain the texture regions used by this mod's custom FurnitureTypes. Note that the furniture texture needs to have an associated MLEM.Data.DataTextureAtlas file in the same location, but with the .atlas file extension. By default, an empty IEnumerable<T> is returned.

public virtual IEnumerable<string> GetCustomFurnitureTextures(ModInfo info)


info ModInfo



The custom data texture atlases for this mod's furniture

Initialize(Logger, RawContentManager, RuntimeTexturePacker, ModInfo)

Initialize the data for this mod, including textures, sounds and other data. The MLEM.Data.Content.RawContentManager is a variation of MonoGame's Microsoft.Xna.Framework.Content.ContentManager and should be used to load mod content.

public abstract void Initialize(Logger logger, RawContentManager content, RuntimeTexturePacker texturePacker, ModInfo info)


logger Logger

The logger that can be used to write info about this mod to the console

content RawContentManager

The content manager for this mod

texturePacker RuntimeTexturePacker

The texture packer that packs added textures into one big texture

info ModInfo

The ModInfo of this mod.

PopulateOptions(Group, ModInfo)

Populates this mod's options section, which can be found in the Mods section of the game's main and in-game menus. If any elements are added to the group provided, a button will display next to this mod to open its options. This mod can create, add, and load custom options using LoadOptions<T>(Func<T>) and SaveOptions<T>(T).

public virtual void PopulateOptions(Group group, ModInfo info)


group Group

The group to add options to.

info ModInfo

The game's mod info.