Class PluginSettings
This contains all the settings for your plugin. To access a setting use GetSetting<T>(string, T?).
To use this class, inject it into the constructor of your plugin.
public class PluginSettings
- Inheritance
-
objectPluginSettings
Properties
Plugin
Gets the plugin these settings belong to
public Plugin Plugin { get; }
Property Value
Methods
GetSetting<T>(string, T?)
Gets the setting with the provided name. If the setting does not exist yet, it is created.
public PluginSetting<T> GetSetting<T>(string name, T? defaultValue = default)
Parameters
namestringThe name of the setting, may not be longer than 128 characters
defaultValueTThe default value to use if the setting does not exist yet
Returns
Type Parameters
TThe type of the setting, can be any serializable type
SaveAllSettings()
Saves all currently loaded settings
public void SaveAllSettings()