Minecraft Java Edition 1.20.3β26.1.2+ | Multiplayer-Safe | Pure Datapack
dataLib is a utility library developed as a pure datapack for Minecraft Java Edition 1.20.3β26.1+. Its Fabric mod counterpart, dataLib-Fabric, is still under active development, while this repository is being archived.
| Feature | Value |
|---|---|
| Latest version | v5.1.1 |
Main pack_format |
101 (26.1.x) |
| Supported range | pack_format 26β400000 (1.20.3β26.1.2+) |
| Overlay count | 6 (1_20_3, 1_20_5, _pre_1_21_4, compat_1_21_4, 1_21_5, 1_21_6, 26_1) |
| Dependencies | Lantern Load, StringLib (bundled) |
- The Fabric mod version, dataLib-Fabric, provides the same functionality with a more powerful API.
- Maintaining the datapack version in a pure
mcfunctionenvironment requires significantly higher maintenance effort compared to the Fabric mod version. - Considering the breaking changes introduced in 26.1.2+ (
enable-command-blockswas moved to thecommand_blocks_workgamerule) and the likelihood of further compatibility breaks in future versions, no active update plan is currently intended.
Current version: v5.1.1
π‘οΈ This is a Minecraft Datapack β it contains no executables or scripts outside of
.mcfunctionfiles. Some antivirus software may flag.mcfunctionfiles as suspicious due to macro-like syntax. This is a false positive. The pack has been scanned on VirusTotal and returned clean. Only download from this official repository. Do not trust redistributed or repackaged versions from third-party sources.
1. Place dataLib-v5.1.1 into <world>/datapacks/
2. /reload
3. /function dl_load:load/yes
4. /tag @s add datalib.admin
5. /scoreboard players set @a[tag=datalib.admin] dl.perm_level 3
datalib:engine (persistent data)
βββ global
β βββ version: "v5.1.1"
β βββ tick: <int>
βββ players
β βββ Steve { coins:150, level:5, xp:2300, online:1b, ... }
βββ queue
β βββ [{func:"mypack:event/end", delay:100}]
βββ cooldowns
β βββ Steve { fireball: 2460, dash: 1870 } β expiry ticks
βββ events
βββ on_join: [{func:"mypack:welcome"}, {func:"mypack:xp_bonus"}]
datalib:input (sending data to a function)
datalib:output (receiving results from a function)
Used with execute if predicate <id>.
| Predicate | Description |
|---|---|
datalib:is_survival |
Player is in survival mode |
datalib:is_creative |
Player is in creative mode |
datalib:has_empty_mainhand |
Main hand is empty |
datalib:is_full_health |
Player is at full health (20 HP) |
datalib:is_sneaking |
Player is sneaking |
datalib:is_sprinting |
Player is sprinting |
datalib:is_burning |
Player is on fire |
datalib:is_on_ground |
Player is on the ground |
datalib:is_daytime |
Daytime (0β12000 ticks) |
datalib:is_raining |
It is raining |
datalib:is_thundering |
There is a thunderstorm |
datalib:in_overworld |
Player is in the Overworld |
datalib:in_nether |
Player is in the Nether |
datalib:in_end |
Player is in the End |
Full reference: Predicate Reference
Repository: https://github.com/LanternMC/load
License: BSD 0-Clause (public domain)
Provides deterministic load order, version tracking, and pre/load/post-load hooks.
# Check if dataLib is loaded
execute if score dataLib load.status matches 1.. run say dataLib is loaded
# Get version (major*10000 + minor*100 + patch β v5.1.1 = 50000)
scoreboard players get dataLib load.statusRepository: https://github.com/CMDred/StringLib
License: MIT
Bundled under the stringlib namespace. Exposed via datalib:core/lib/string/*.
| Function | Description |
|---|---|
lib/string/concat |
Join a string array |
lib/string/find |
Find substring index |
lib/string/replace |
Replace substring |
lib/string/split |
Split by separator |
lib/string/insert |
Insert at index |
lib/string/to_lowercase |
Lowercase (AβZ, fast) |
lib/string/to_uppercase |
Uppercase (aβz, fast) |
lib/string/to_number |
String β numeric NBT |
lib/string/to_string |
Value β string |
All functions read from datalib:input and write to datalib:output string.result.
data modify storage datalib:input string set value "Hello World"
data modify storage datalib:input find set value "World"
data modify storage datalib:input replace set value "Everyone"
function datalib:core/lib/string/replace
# datalib:output string.result β "Hello Everyone"dataLib v5.1.1 | MC Java 1.20.3β26.1+ | Pure Datapack