"Raycast Improved"
Welcome to the third Alpha release! This update is focused entirely on the Raycast module—making it more flexible, more powerful, and easier to use with custom range.
If you are upgrading from v0.0.1-2, you must update your function calls.
tiny_datalib:raycast/blocktiny_datalib:raycast/block {range:<range>,notfound:<notfound>}Return Codes:
Any: Success.None/Fail: Maybe wrong range/notfound (Must be specified!).<notfound>: No block wasn't found."Raycast Improved"
Welcome to the third Alpha release! This update is focused entirely on the Raycast module—making it more flexible, more powerful, and easier to use with custom range.
If you are upgrading from v0.0.1-2, you must update your function calls.
tiny_datalib:raycast/blocktiny_datalib:raycast/block {range:<range>,notfound:<notfound>}Return Codes:
Any: Success.None/Fail: Maybe wrong range/notfound (Must be specified!).<notfound>: No block wasn't found."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.
"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.
Welcome to the initial alpha release of Tiny DataLib! This version focuses on providing essential, robust utility functions for your datapack development.
# data modify storage tiny_datalib:temp distance.UUID1 set from entity <Entity1> UUID ## Entity 1
# data modify storage tiny_datalib:temp distance.UUID2 set from entity <Entity2> UUID ## Entity 2
# function tiny_datalib:calc/distance with storage tiny_datalib:temp distance ## Make sure that both UUID's are valid.
# data modify storage tiny_datalib:temp distance set value {} ## Use if you want to reset function.
## Return types:
# Any -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
# function tiny_datalib:database/save/add
## DATABASE ADD SAVE FUNCTION
#
## Example:
# function tiny_datalib:database/save/add with entity @s ## Adds a new save to database with key as a players UUID
##
#
## Return types:
# -1 -- UUID already exists (NO ERROR - UUID ALREADY EXISTS INSIDE OF SAVES)
# 1 -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
# function tiny_datalib:database/save/remove
## DATABASE REMOVE SAVE FUNCTION
#
## Example:
# function tiny_datalib:database/save/remove with entity @s ## Removes save from database with key as a players UUID
##
#
## Return types:
# -1 -- UUID doesnt exists (NO ERROR - PLAYER ISNT INSIDE OF SAVES)
# 1 -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
# function tiny_datalib:database/data/get
## DATABASE GET SAVE FUNCTION
#
## Example:
# function tiny_datalib:database/data/get with entity @s ## Gets save from UUID and puts it inside storage tiny_datalib:database output
##
#
## Return types:
# -1 -- UUID doesnt exists (NO ERROR - UUID ISNT INSIDE OF SAVES)
# 1 -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
# function tiny_datalib:database/data/set
## DATABASE SET SAVE FUNCTION
#
## Example:
# function tiny_datalib:database/data/set with entity @s ## Sets save from UUID to data from storage tiny_datalib:database save
##
#
## Return types:
# -1 -- UUID doesnt exists (NO ERROR - UUID ISNT INSIDE OF SAVES)
# 1 -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
# function tiny_datalib:database/var/get
## DATABASE GET VAR FUNCTION
#
## Example:
# function tiny_datalib:database/var/get {with:"entity @s",var:"",none:0} ## Gets variable from player. var must be valid and none is the value that you will get if it doesnt exist.
##
#
## Return types:
# Any -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
# function tiny_datalib:database/var/set
## DATABASE SET VAR FUNCTION
#
## Example:
# function tiny_datalib:database/var/set {with:"entity @s",var:"",value:0} ## Sets/Creates variable for player. Value must be number!
##
#
## Return types:
# -1 -- UUID doesnt exists (NO ERROR - UUID ISNT INSIDE OF SAVES)
# 1 -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
# function tiny_datalib:give/item
## CUSTOM GIVE FUNCTION
#
## Example:
# data modify storage tiny_datalib:temp item set from entity @s SelectedItem ## Data item can be anything as long as it has id and count specified...
# function tiny_datalib:give/item ## No macro isnt used and storage cannot be changed, This function MUST be run as a player.
# data modify storage tiny_datalib:temp item set value {} ## Use if you want to reset function.
##
#
## Return types:
# -1 -- Wrong id (ERROR - MAYBE WRONG ITEM)
# -2 -- Wrong count (ERROR - MAYBE WRONG ITEM)
# -3 -- Wrong UUID (ERROR - FUNCTION MUST BE RUN AS A PLAYER)
# 1 -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
# function tiny_datalib:give/item/macro
## CUSTOM MACRO GIVE FUNCTION
#
## Example:
# function tiny_datalib:give/item/macro {with:"entity @s", data:"SelectedItem"} ## Make sure that its all valid, Function must be runned as a player
##
#
## Return types:
# -1 -- Wrong id (ERROR - MAYBE WRONG ITEM)
# -2 -- Wrong count (ERROR - MAYBE WRONG ITEM)
# -3 -- Wrong UUID (ERROR - FUNCTION MUST BE RUN AS A PLAYER)
# 1 -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
# function tiny_datalib:raycast/block
## RAYCAST BLOCK FUNCTION
#
## Example:
# function tiny_datalib:raycast/block ## Maximum range - 32, Custom range will be added in future updates...
##
#
## Return types:
# Any -- Sucessful (NO ERROR)
# None/Fail -- Something went wrong (ERROR - PLEASE CHECK IF YOU HAVE EVERYTHING CORRECT)
##
We are already working on the next set of features to improve performance and add utility:

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