- Install JDK 21 and IntelliJ IDEA
- Clone the fabric-example-mod template from GitHub as your starting point
- Configure
gradle.propertieswith your mod name, id (askthevault), version and Minecraft/Fabric versions - Do a test build and make sure a blank mod loads in Prism without crashing
- Register a custom command using Fabric's command API (e.g.
/query <sql>) - Learn how Fabric events work by listening for the command being fired
- Write a response back to the player's chat using the server's
sendMessageAPI - Test with a hardcoded response first ("it works!") before touching the database
- Add the SQLite JDBC driver as a dependency in your
build.gradle - Write a
DatabaseManagerclass that opens a connection to your.dbfile - Execute the SQL query from the chat command against the database
- Format the results into readable chat messages and send them back to the player
- Handle bad SQL queries gracefully (wrong syntax, no results, etc.)
- Make the database path configurable so it works on other machines too
- Add a permission check so only you can run queries (important if you ever play multiplayer)
- Write a basic README explaining how to set it up and use it