PySpigot Configuration¶
The following page provides information on all configuration values that can be found in PySpigot's config.yml
.
metrics-enabled
¶
Specifies whether PySpigot will collect metrics data and submit this data to bStats. Set to false
to disable collection of metrics data. You may also disable bStats server-wide in the bStats config file under /plugins/bStats
.
Default: true
script-load-delay
¶
The delay, in ticks, that PySpigot will wait after server loading is completed to load scripts. There are 20 server ticks in one real-world second. For example, if the value is 20, then PySpigot will wait 20 game ticks (or 1 real-world second) after the server finishes loading to load scripts. Set to -1
to disable a load delay and load scripts immediately.
Default: 20
library-relocations
¶
List of relocation rules for external Java libraries in the java-libs
folder. This feature is useful to relocate class names of an external Java library if a different version of the library is already present and in use by another plugin on the server. Format as <pattern>|<relocated pattern>
.
Default: None (empty list)
log-timestamp-format
¶
The Date/time format that should be used to timestamp log messages when printing them to a script's log file. The timestamp should be in an appropriate SimpleDateFormat.
Default: MMM dd yyyy HH:mm:ss
script-action-logging
¶
Specifies whether or not messages should be printed to console when a script is loaded, unloaded, and reloaded.
Default: true
verbose-redis-logging
¶
Specifies whether all redis events should be logged to a script's logger, or if only crucial events should be logged. Crucial events include reconnect attempts and reconnect failures. If set to false
, only these crucial events will be logged.
Default: true
script-unload-on-plugin-disable
¶
Specifies whether a script should be automatically unloaded if a plugin it depends on is unloaded. This value only applies to scripts that have plugin dependencies listed in the script_options.yml
file. This feature is especially useful to ensure that when a script depends on a plugin, its shutdown tasks complete successfully if one or more of the plugins it depends on is/are disabled.
Default: true
jython-options
¶
This section allows you to specify options that pertain to Jython.
init-on-startup
¶
Specifies whether or not Jython should be initialized on plugin load. If this is set to true
, script load times can be reduced by initializing Jython earlier (during server startup) rather than just prior to loading the first script.
Default: true
properties
¶
A list of properties that should be passed to Jython when it is initialized. By default, the python.cachedir.skip
property is passed with a value of true
. Unless you know what you are doing, this option should be left as-is, as under normal circumstances, embedded Jython should not utilize a cache directory.
See this page for a more detailed explanation as well as the RegistryKey class in the Jython source code for a complete list of Jython properties.
Default: List containing python.cachedir.skip=true
args
¶
A list of arguments that should be passed to Jython when it is initialized. This is equivalent to the sys.argv
list in regular Python.
Default: None (empty list)
script-option-defaults
¶
The script option defaults are default script options that can be specified. The options defined in this section serve as fallback falues that should be used in the case that a script has one or more script options that aren't defined in the script_options.yml
file.
main
¶
Specifies the main module for a project (this option is not applicable to a single-file script). PySpigot uses this to determine which module should be executed when the project loads. This is akin to calling python main.py
for a multi-module Python project, where main.py
is the main module for the project.
Default: main.py
enabled
¶
Used to enable or disable a script or project. To disable a script/project, set this value to false
.
Default: true
load-priority
¶
Specifies an integer load priority for the script or project. Scripts and projects are loaded in order from highest to lowest load priority. In other words, scripts/projects that have a higher load priority are loaded earlier, and scripts/projects with a lower load priority are loaded later. If multiple scripts/projects have the same load priority, they are loaded in alphabetical order.
Default: 1
plugin-depend
¶
Specifies a list of plugins that the script or project depends on. The script/project will not load if any of the plugin dependencies are not loaded and running on the server. Additionally, if the [#script-unload-on-plugin-disable] parameter is set to true
, any scripts/projects that depend on that plugin as specified under this option are automatically unloaded when the plugin is unloaded/disabled.
Note
If you are working with ProtocolLib or PlaceholderAPI in your script or project, you do not need to specify either of them here. PySpigot has built-in support for these two plugins, and the dependency management is handled automatically.
Default: None (empty list)
file-logging-enabled
¶
Specifies if script/project file logging should be enabled. If this option is true
, a script/project log file will be generated, and any error messages (and print messages sent to the script/project's logger) will be logged to this file. If set to false
, no messages will be logged to a log file, but messages will still be printed to the server console.
Default: true
min-logging-level
¶
Specifies the minimum logging level that should be logged to the script/project's log file and the console. Options can be found on the JavaDocs.
Default: INFO
permissions
¶
Specify a list of permissions that the script/project uses. This is useful for scripts or projects that want to restrict access to certain features. This section is defined in the exact same way that permissions are defined in the plugin.yml
file for a Bukkit plugin. See usage code example below for how to define permissions, defaults, and child permissions.
description
is a description of the permission node, and this is what will be displayed in the permissions list. The default value is the name of the permission node.default
is the default value of the permission node, or, in other words, who should have the permission node by default. There are four possible values fordefault
:op
: Only server operators will have the permission node by default.not op
: Players who are not operators will have the permission node by default.true
: All players will have the permission (I.E. it is a default permission).false
: No players will have the permission (I.E. it is not a default permission). The default value is the value ofdefault_permission
(outlined below).children
is a list of child permissions that should inherit from the parent permission. Each permission node may have children. When set totrue
, the child will inherit the parent permission.
Default: None (no permissions defined)
permission-default
¶
Specify a default value that permissions should have, if they do not have a default
value defined. The allowed values for permission-default
are op
, not op
, true
, and false
:
op
: Only server operators will have the permission node by default.not op
: Players who are not operators will have the permission node by default.true
: All players will have the permission (I.E. it is a default permission).false
: No players will have the permission (I.E. it is not a default permission).
Default: op
debug-options
¶
The configuration values in the default-options
section are more advanced options that should only be changed if you encounter issues or would like to disable recommended features.
print-stack-traces
¶
Specifies if full stack traces should always be printed to the server console. Normally, if a Java exception occurs, a condensed version of the Java exception along with a Python traceback are printed, but if this parameter is set to true
, a full Java stack trace will be printed in addition to a Python traceback.
Default: false
show-update-messages
¶
Specifies whether the plugin should show messages in console and on join (to players with the permission pyspigot.admin
) when a newer version of PySpigot is available to download on spigotmc.org. If set to false
, no update messages will be shown, even if a newer version of the plugin is available.
Default: true
jython-logging-level
¶
Specifies the logging level at which the internal Jython logger logs messages. It can be useful to set this to FINE
or ALL
for debugging purposes, to get a better sense of what Jython is doing internally. Note that for Jython log messages to show at the appropriate level, the server-wide logging level would also need to be adjusted accordingly.
Default: INFO
patch-threading
¶
Specifies whether or not a patch should be applied to the threading
module on script unload. This patch is aimed at fixing a bug that occurs when using the threading module from within an asynchronous task. For more information, see this GitHub issue report. Under most circumstances, this should be set to true
.
Default: true
Example Configuration¶
The following example configuration contains default values for all parameters.