Documentation
Configuration
A walkthrough of the PixelScript configuration options and how to customize them for your server setup.
PixelScript Configuration
PixelScript has three configuration files that allow you to customize its behavior to fit your server setup. These files are located in the plugins/PixelScript directory of your Minecraft server.
The class search context config
The class-searchcontext.yml file lists a few packages that will be searched by the $ global when you try to import a class through it, with the default config being
search-packages: - 'org.bukkit' - 'com.destroystokyo.paper' - 'org.spigotmc'
You can read more on this in the Magic Imports documentation.
The main configuration file
This file is a bit bare-bones for now, only doing one thing at the moment: configuring runtime order.
All scripts are loaded as soon as the PixelScript plugin is loaded by the server, but sometimes you need to wait on external dependencies (like your own plugin) to be loaded first. To facilitate this, you can specify a list of plugin names that need to be loaded before PixelScript starts loading scripts.
# Wait until these plugins are loaded before we start to initialize scripts required-plugin-dependencies: #- 'Vault' #- 'LuckPerms' # The name of the plugin that will be used to load the scripts
Please note that there is no timeout for this wait; if a plugin is listed here that never loads, PixelScript will let the server to continue starting up, but scripts will never be loaded. Scripts will be loaded as soon as all listed plugins are loaded, which will still be blocking the first tick of the server.
SQL module configuration
PixelScript ships with a built-in SQL module for convenient database access from your scripts, backed by HikariCP connection pooling.
It defaults to a SQLite database located in the plugin folder, but this can be swapped out by editing the database.yml file:
# PixelScript Database Configuration # =========================== # # This file controls the database settings for PixelScript # # Available database types: # - sqlite: Embedded database stored in a file (recommended for single server setups) # - mysql: External MySQL/MariaDB database (recommended for multi-server networks) # Database type (sqlite or mysql) type: sqlite # SQLite Configuration # =================== sqlite: # The database file name (located in the plugin folder) file: database.db # MySQL Configuration # ================= mysql: # MySQL server hostname or IP address host: localhost # MySQL server port port: 3306 # Database name database: pixelscript # MySQL username username: root # MySQL password password: "" # Connection Pool Settings # ====================== connection_pool: # Number of connections to maintain in the pool # For SQLite, this is always 1 regardless of this setting size: 10 # Connection timeout in milliseconds timeout: 30000
Whats next?
Now that your environment is set up and configured, it's time to start building your first PixelScript systems! Head over to the next step, introduction to scripts, to get started with writing your first script.
A step-by-step guide to setting up your development environment for PixelScript, including installing necessary tools and configuring your IDE.
A walkthrough of scripts, how they're loaded, and how to organize your script files.