FlatFileStorageAPI is a lightweight and easy-to-use plugin designed for
Bukkit/Spigot/Paper Minecraft servers. It allows you to store persistent data in a
flatfile storage system.
The plugin supports Java 14 to 21 and higher, as well as Minecraft server versions from 1.14 to 1.21+.
Currently, the plugin supports many data types and is constantly evolving, with new advanced types being implemented, such as Bukkit classes ( ItemStack, Location).
All loaded data is stored in RAM with O(1) access speed because Java efficiently manages memory, such as in the case of a HashMap holding 10,000,000 UUIDs, which typically requires around 160MB of memory (though overhead may increase total usage to approximately 300MB).
You should organize your data into multiple files, each containing specific data types (e.g., PlayerData, Islands, etc.) to maximize loading and saving speed.
Time(1M UUIDs):
Supported Data Types:
Using Var for Data Management
Installation & Setup
1. Download the API
Before using Var, you need to download the API and include it in your project.
2. Add it to Your Project
To create a new Var instance, use the following code:
This initializes a
Var linked to the
current instance (instance, where the file will be stored) and the specified
path ("filePath"). Once created, this
Var can store and manage data with supported variable types.
Methods & Usage
1. Setting a Value
Use setValue to store a value under a specific key with its associated type.
Example:
This assigns a
UUID value to the key "key".
2. Retrieving a Value
Use getValue to retrieve a stored value based on its key and type.
Example:
You can also specify a
default value in case the key is missing:
3. Saving Data
To save the current state of the Var, use saveSync() or saveAsync().
Example:
This persists the stored data to
disk or storage.
Saving Asynchronously
For better server performance, use saveAsync() to save data in the background.
Example:
This prevents lag by handling the save operation
off the main thread.
4. Unloading Data from Memory
No strong reference will hold your Var except yourself; to unload it, simply remove your strong references. The GC(Garbage Collector) will remove it by itself.
This ensures that the Var’s data is removed from RAM, optimizing performance.
5. Retrieving All Stored Keys
Use getKeys() to get a list of all stored keys inside a Var.
Example:
This allows you to check all available data stored in the
Var.
If you have any issues or suggestions, join our Discord: https://discord.gg/veZJqU5wkT
![[IMG]](//proxy.spigotmc.org/adde9fcbc9b2b8b931164514e10818083ef58fa0/68747470733a2f2f6273746174732e6f72672f7369676e6174757265732f62756b6b69742f466c617446696c6553746f726167654150492e737667)
The plugin supports Java 14 to 21 and higher, as well as Minecraft server versions from 1.14 to 1.21+.
Currently, the plugin supports many data types and is constantly evolving, with new advanced types being implemented, such as Bukkit classes ( ItemStack, Location).
All loaded data is stored in RAM with O(1) access speed because Java efficiently manages memory, such as in the case of a HashMap holding 10,000,000 UUIDs, which typically requires around 160MB of memory (though overhead may increase total usage to approximately 300MB).
You should organize your data into multiple files, each containing specific data types (e.g., PlayerData, Islands, etc.) to maximize loading and saving speed.
Time(1M UUIDs):
- Set: 128ms ✅ O(1)
- Get: 128ms ✅ O(1)
- Save: 940ms
- Load: 822ms
Supported Data Types:
- Types: String, UUID, Integer, BigInteger, Double, BigDecimal, Float, Short, Long, Boolean, Byte, Character, Material.
- Bukkit Types: Location, ItemStack.
- Bukkit Representation Types: Chunk, World, Inventory.
- Collections: List, Set, Array
- Map Types: HashMap, LinkedHashMap
Documentation
Installation & Setup
1. Download the API
Before using Var, you need to download the API and include it in your project.
2. Add it to Your Project
- If using Maven, add the JAR to the /libs folder of your plugin project and declare it in your pom.xml:
Code (Java):
<dependency
>
<groupId >your. group. id </groupId >
<artifactId >FlatFileStorageAPI </artifactId >
<version > 1.0 </version >
<scope >system </scope >
<systemPath >$ {project. basedir } /libs /FlatFileStorageAPI. jar </systemPath >
</dependency >
<groupId >your. group. id </groupId >
<artifactId >FlatFileStorageAPI </artifactId >
<version > 1.0 </version >
<scope >system </scope >
<systemPath >$ {project. basedir } /libs /FlatFileStorageAPI. jar </systemPath >
</dependency >
- If using Gradle, add it as a local dependency.
To create a new Var instance, use the following code:
Code (Java):
getOrLoadVarAsync
(instance, filePath
).
thenAccept
(var
->...
;
Methods & Usage
1. Setting a Value
Use setValue to store a value under a specific key with its associated type.
Example:
Code (Java):
var.
setValue
(VarTypes.
UUID,
"key", UUID.
randomUUID
(
)
)
;
2. Retrieving a Value
Use getValue to retrieve a stored value based on its key and type.
Example:
Code (Java):
UUID value
= var.
getValue
(VarTypes.
UUID,
"key"
)
;
Code (Java):
UUID value
= var.
getValue
(VarTypes.
UUID,
"key", defaultValue
)
;
To save the current state of the Var, use saveSync() or saveAsync().
Example:
Code (Java):
var.
saveSync
(
)
;
Saving Asynchronously
For better server performance, use saveAsync() to save data in the background.
Example:
Code (Java):
var.
saveAsync
(
)
;
4. Unloading Data from Memory
No strong reference will hold your Var except yourself; to unload it, simply remove your strong references. The GC(Garbage Collector) will remove it by itself.
This ensures that the Var’s data is removed from RAM, optimizing performance.
5. Retrieving All Stored Keys
Use getKeys() to get a list of all stored keys inside a Var.
Example:
Code (Java):
Set
<String
> keys
= var.
getKeys
(
)
;
If you have any issues or suggestions, join our Discord: https://discord.gg/veZJqU5wkT
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.14, 1.15, 1.16
- 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.
FlatFileStorageAPI | [1.14 - 1.21.x] ⚡ Java API [DISCONTINUED] is a free Minecraft Java mod. Compatible with Minecraft 1.14, 1.15, 1.16, 1.17 and newer. Downloaded 272 times (via Spigot). Download it and open it directly in the game.