"The Database Expansion"
Welcome to the second Alpha release! This update is focused entirely on the Database module—making it more flexible, more powerful, and easier to use with any data key, not just player UUIDs.
var/math system lets you perform operations (+=, *=, etc.) directly on database variables.get/set for specific paths vs get_full/set_full for entire objects.If you are upgrading from v0.0.1, you must update your function calls.
tiny_datalib:database/save/...tiny_datalib:database/entry/...Use these functions to initialize or delete a slot in the database.
| Function | Method | Description |
|---|---|---|
entry/add | Entity UUID | Creates a new entry using the executor's UUID. |
entry/add/macro | {ENTRY: <key>} | Creates a new entry using a custom key (String/NBT). |
entry/remove | Entity UUID | Deletes the entry associated with the executor. |
entry/remove/macro | {ENTRY: <key>} | Deletes the entry associated with the custom key. |
Return Codes:
1: Success.-1: Entry already exists (for add) or doesn't exist (for remove).These functions handle raw NBT data. Useful for saving inventories, complex state machines, or nested objects.
Used for specific paths within an entry.
# Example: Set a specific path
function tiny_datalib:database/data/set {with:"entity @s", data:"Inventory"}
# Example: Get a specific path from a custom entry
function tiny_datalib:database/data/get/macro {ENTRY:"GlobalConfig", data:"Settings.Difficulty"}
Used to overwrite or retrieve the entire entry object.
# Example: Backup an entire player entry to storage
function tiny_datalib:database/data/get_full with entity @s
Return Codes:
1: Success.-1: Entry/UUID not found.-2: Specific data path not found.This is the most powerful part of v0.0.2. You can now manipulate numbers stored in the database without manually pulling them to a scoreboard first.
Supports all standard scoreboard operations: +=, -=, *=, /=, %=, =, <, >, ><.
# Example: Adding 10 to a player's "Mana" variable
function tiny_datalib:database/var/math {with:"entity @s", var:"Mana", math:"+=", mathvalue:10}
# Example: Multiplying a custom entry variable
function tiny_datalib:database/var/math/macro {ENTRY:"WorldData", var:"DayCount", math:"*=", mathvalue:2}
# Example: Set a variable directly
function tiny_datalib:database/var/set {with:"entity @s", var:"Level", value:5}
# Example: Get a variable with a fallback (none) if it doesn't exist
function tiny_datalib:database/var/get {with:"entity @s", var:"Coins", none:0}
When using entry/add/macro, your ENTRY key can be a simple string like "Global_Settings". This makes it incredibly easy to store data that isn't tied to a player, like a custom shop's stock or world-wide event progress.

This project is a library with useful utilities such as a database system and more.