Tags
Creators
Details
0.0.1
Compatibility
Changes
Tiny DataLib v0.0.1 ALPHA: Core Utilities
Welcome to the initial alpha release of Tiny DataLib! This version focuses on providing essential, robust utility functions for your datapack development.
Key Features in v0.0.1
- Distance Calculation: Get the precise distance between any two entities by their UUID.
- Database: A flexible, UUID-based data storage system for persistent entity data.
- Custom Give: Safely give players complex items, easily fetching data from existing item data structures (like a chest slot).
- Raycast Block: Quickly determine what block an entity is looking at and how far away it is.
Usage Examples
Distance Calculation
# 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)
Database
Add new save to database
# 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)
##
Remove save from database
# 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)
##
Get data from save in database
# 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)
##
Set new data to save in database
# 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)
##
Get variable from save in database
# 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)
##
Set new or update variable from save in database
# 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)
##
Custom Give
Custom Give no macro
# 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)
##
Custom Give with macro
# 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)
##
Raycast Block
# 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)
##
Future Plans (Coming Soon!)
We are already working on the next set of features to improve performance and add utility:
- Raycasting: Custom range options and improved block detection accuracy.
- Distance: Better calculation for reduced lag.
- Custom Give: Implementing item stacking to avoid dropping or unnecessary slot usage.
- Database: Advanced features including variable calculation and optimized data get/set operations.
- New Modules: Mannequin controls and more!
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:5lSSrR4X:fq2iVnWI"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:5lSSrR4X:fq2iVnWI"
}

