ModsJava
Minecraft Appwrite SDK
Java mod listed for Minecraft 1.17. Download on the author's site.
⬇ Download on Spigot Appwrite Minecraft SDK
Utility Minecraft plugin that creates persistent data storage while using Appwrite as a database. This plugin was a missing piece on the scene for years! Finally, with Appwrite Minecraft SDK, storing data is as simple as
A server makes no longer needs to pay over-priced developers just because there is no simple way to store data without writing Java code.
Showcase
I am a server administrator, I have no coding experience, and I want to customize my server...
I have a dungeon minigame already created, but I don't want to let players play it infinitely; instead, I want to make this minigame a special reward. First, I start by running a command to define the variable availableDungeonKeys when a player first joins my server and set it to 0:
Great, now when a new player joins, he will automatically have 3 keys.
When starting a minigame, I can use the placeholder
to get the value and check if the amount is higher than 0. If that is the case, I can run a command to take 1 key from the player:
Now that I have taken one key from the player, I can let him into a minigame. Tada I have just created a system where players can join my minigame, but they can only do it 3 times.
Finally, I add an option to purchase more keys to my web-store and run the command once they purchase the keys:
Let's take a look at another scenario... Let's say I need an energy system so the player can only join the minigame when he has at least 1 energy. Instead of buying it, he needs to collect 25 fragments in order to convert it to 1 energy. Fragments can be obtained by breaking a special block on the spawn. How do I achieve that? It's extremely simple!
Let's start.. First, define variables when a player joins for the first time:
Notice how I marked fragments local because I want to lose the value when a player leaves the server - I don't want to store that.
Now, when a player breaks the specific block, I can run a command to increase his fragments count:
In this event, I also use placeholder
to check if he has at least 25, and if that is the case, I reset it to 0 while increasing the energy count:
Wohoo, energy system finished Here is a working example of such a logic:
How to install
Aliases: appwrite | aw Example of commands usage:
⚙️ config.yml
In the config.yml file, you can configure the connection to the Appwrite server.
API
Before using the API, make sure your plugin is set up a valid Maven project.
First things first, you have to import the project from JitPack. To do that, you enter pom.xml of your project and add repository and dependency.
Then, you can start using the API from class AppwriteDatabaseAPI, for example:
PlaceholdersAPI
Plugin version Description 1.17 1.16 1.14 1.12 1.8 1.7 1.5
0.0.1 First release of plugin ✔️ ❌ ❌ ❌ ❌ ❌ ❌
0.0.2 Huge refactor ✔️ ❌ ❌ ❌ ❌ ❌ ❌
0.0.3 Fixed JitPack build ✔️ ❌ ❌ ❌ ❌ ❌ ❌
❓ FAQ
Where to use local and where remote variables?
Local variables are those that don't save in the database. On the other hand, remote variables are those that are saved in the database. That means you can use local variables as much as you want, and they'll never be stored in the database. Fun fact: You can create a local variable and then just set it as remote and vice versa.
Types of variables
You can use several variables types. Once you choose the type, you cannot change it - you must delete and then create in again to override the type.
Types:
![[IMG]](//proxy.spigotmc.org/5ab48d8e14a31f84034c8ed14af9e83411819fdf?url=https%3A%2F%2Fappwrite.io%2Fimages-ee%2Fpress%2Fbadge-pink-box.svg)
Utility Minecraft plugin that creates persistent data storage while using Appwrite as a database. This plugin was a missing piece on the scene for years! Finally, with Appwrite Minecraft SDK, storing data is as simple as
/appwrite database NiX3r set money 50Click to expand...
Showcase
I am a server administrator, I have no coding experience, and I want to customize my server...
I have a dungeon minigame already created, but I don't want to let players play it infinitely; instead, I want to make this minigame a special reward. First, I start by running a command to define the variable availableDungeonKeys when a player first joins my server and set it to 0:
/appwrite database player set-remote %playername% availableDungeonKeys 3Click to expand...
When starting a minigame, I can use the placeholder
%aw_p_availableDungeonKeys%Click to expand...
/appwrite database player take-remote %playername% availableDungeonKeys 1Click to expand...
Finally, I add an option to purchase more keys to my web-store and run the command once they purchase the keys:
/appwrite database player add-remote %playername% availableDungeonKeys 10Click to expand...
Let's start.. First, define variables when a player joins for the first time:
/appwrite database player set-remote %playername% energy 5
/appwrite database player set-local %playername% fragments 0Click to expand...
Now, when a player breaks the specific block, I can run a command to increase his fragments count:
/appwrite database player add-local %playername% fragments 1Click to expand...
%aw_p_fragments%Click to expand...
/appwrite database player add-remote %playername% energy 1
/appwrite database player set-local %playername% fragments 0Click to expand...
How to install
- Download the latest plugin from Spigot (TODO)
- Copy the jar file into the server plugins folder
- Start / Restart the server to trigger the first load of the plugin
- Insert Appwrite endpoint, project ID and API key into the generated config.yml file
- Restart the server
- Enjoy Appwrite Database plugin!
Aliases: appwrite | aw Example of commands usage:
- Help
- Command to show help menu in the game
- Usage: /appwrite help
- Command to show help menu in the game
- Version
- Command to show the currently installed version
- Usage: /appwrite version
- Aliases: version | ver | v
- Permisson: appwrite.version
- Command to show the currently installed version
- Database
- Command for work with the data storage
- Aliases: database | db
- Sub commands:
- Player
- Command to work with data of a specific player
- Aliases player | p
- Sub commands:
- Save
- Command for save cache into the database. This is triggered automatically when player leaves the server, but you can use this command to store it at a specific point.
- Usage: appwrite database player save <player>
- Aliases: save | s
- Permission: appwrite.player.save
- Command for save cache into the database. This is triggered automatically when player leaves the server, but you can use this command to store it at a specific point.
- Set Local
- Command to set a value of local variable
- Usage: appwrite database player set-local <player> <key> <value>
- Aliases: set-local | sl
- Permission: appwrite.player.set.local
- Command to set a value of local variable
- Set Remote
- Command to set a value of remote variable
- Usage: appwrite database player set-remote <player> <key> <value>
- Aliases: set-remote | sr
- Permission: appwrite.player.set.remote
- Command to set a value of remote variable
- Add Local
- Command to increase a value of local variable
- Usage: appwrite database player add-remote <player> <key> <value>
- Aliases: add-local | al
- Permission: appwrite.player.add.local
- Command to increase a value of local variable
- Add Remote
- Command to increase a value of remote variable
- Usage: appwrite database player add-remote <player> <key> <value>
- Aliases: add-remote | ar
- Permission: appwrite.player.add.remote
- Command to increase a value of remote variable
- Take Local
- Command to decrease a value of local variable
- Usage: appwrite database player take-local <player> <key> <value>
- Aliases: takel-local | tl
- Permission: appwrite.player.take.local
- Command to decrease a value of local variable
- Take Remote
- Command to decrease a value of remote variable
- Usage: appwrite database player take-remote <player> <key> <value>
- Aliases: take-remote | tr
- Permission: appwrite.player.take.remote
- Command to decrease a value of remote variable
- Get
- Command to get a value of remote variable
- Usage: appwrite database player get <player> <key>
- Aliases: get | g
- Permission: appwrite.player.get
- Command to get a value of remote variable
- Save
- Command to work with data of a specific player
- Global
- Command to work with global database. Here you can store variables that are shared for everyone one the server.
- Aliases global | g
- Sub commands:
- Save
- Command to save the global cache into database
- Usage: appwrite database global save
- Aliases: save | s
- Permission: appwrite.global.save
- Command to save the global cache into database
- Set Local
- Command to set a value of local variable
- Usage: appwrite database global set-local <key> <value>
- Aliases: set-local | sl
- Permission: appwrite.global.set.local
- Command to set a value of local variable
- Set Remote
- Command to set a value of remote variable
- Usage: appwrite database global set-remote <key> <value>
- Aliases: set-remote | sr
- Permission: appwrite.global.set.remote
- Command to set a value of remote variable
- Add Local
- Command to increase a value of local variable
- Usage: appwrite database global add-remote <key> <value>
- Aliases: add-local | al
- Permission: appwrite.global.add.local
- Command to increase a value of local variable
- Add Remote
- Command to increase a value of remote variable
- Usage: appwrite database global add-remote <key> <value>
- Aliases: add-remote | ar
- Permission: appwrite.global.add.remote
- Command to increase a value of remote variable
- Take Local
- Command to decrease a value of local variable
- Usage: appwrite database global take-local <key> <value>
- Aliases: takel-local | tl
- Permission: appwrite.global.take.local
- Command to decrease a value of local variable
- Take Remote
- Command to decrease a value of remote variable
- Usage: appwrite database global take-remote <key> <value>
- Aliases: take-remote | tr
- Permission: appwrite.global.take.remote
- Command to decrease a value of remote variable
- Get
- Command to get a value of global variable
- Usage: appwrite database global get <key>
- Aliases: get | g
- Permission: appwrite.global.get
- Command to get a value of global variable
- Save
- Command to work with global database. Here you can store variables that are shared for everyone one the server.
- Player
- Command for work with the data storage
- Reload
- Command to reload configs
- Aliases reload | r
- Sub commands:
- All
- Command to reload all configs
- Usage: appwrite reload all
- Aliases: all | a
- Permission: appwrite.reload.all
- Command to reload all configs
- Messages
- Command to reload messages config
- Usage: appwrite reload messages
- Aliases: messages | msg | m
- Permission: appwrite.reload.messages
- Command to reload messages config
- Config
- Command to reload config
- Usage: appwrite reload config
- Aliases: config | c
- Permission: appwrite.reload.config
- Command to reload config
- All
- Command to reload configs
⚙️ config.yml
In the config.yml file, you can configure the connection to the Appwrite server.
- appwrite.api_endpoint: Your Appwrite endpoint
- appwrite.project_id: Your Appwrite project ID
- appwrite.api_key: Your Appwrite API key
API
Before using the API, make sure your plugin is set up a valid Maven project.
First things first, you have to import the project from JitPack. To do that, you enter pom.xml of your project and add repository and dependency.
...
<repository>
<id>jitpack.io</id>
<url> https://jitpack.io</url>
</repository>
...
<dependency>
<groupId>com.github.nCodesDotEU</groupId>
<artifactId>Appwrite-Minecraft-Database</artifactId>
<version>Tag</version>
</dependency>
...Click to expand...
Code (Java):
- Global
- Placeholder: %aw_g_<key>%
- Stands for global variables
- Placeholder: %aw_g_<key>%
- Player
- Placeholder: %aw_p_<key>%
- Stands for source player variable
- Placeholder: %aw_p_<key>%
- Other Player
- Placeholder: %aw_po_<player>_<key>%
- Stands for different players variable
- Placeholder: %aw_po_<player>_<key>%
- Don't remove local variables
- Aliasses - mathematical formulas to count
- Events - create database events (such as OnDataChange, OnDataLoad, OnDataSave, ...)
- Defaults - default values of variables
- Inspects - inspect players keys, global keys and their values
- TOP 10 - shows top 10
- Merge data with external changes
Plugin version Description 1.17 1.16 1.14 1.12 1.8 1.7 1.5
0.0.1 First release of plugin ✔️ ❌ ❌ ❌ ❌ ❌ ❌
0.0.2 Huge refactor ✔️ ❌ ❌ ❌ ❌ ❌ ❌
0.0.3 Fixed JitPack build ✔️ ❌ ❌ ❌ ❌ ❌ ❌
❓ FAQ
Where to use local and where remote variables?
Local variables are those that don't save in the database. On the other hand, remote variables are those that are saved in the database. That means you can use local variables as much as you want, and they'll never be stored in the database. Fun fact: You can create a local variable and then just set it as remote and vice versa.
Types of variables
You can use several variables types. Once you choose the type, you cannot change it - you must delete and then create in again to override the type.
Types:
- INT - number without a decimal point
- FLOAT - number with a decimal point
- STRING - everything else (typically text)
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.17
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Minecraft Appwrite SDK is a free Minecraft Java mod. Compatible with Minecraft 1.17. Downloaded 106 times (via Spigot). Download it and open it directly in the game.