Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 11 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@
"SPGoding.datapack-language-server",
"ms-python.python",
"ms-python.flake8",
"dlyz.md-link-checker"
"dlyz.md-link-checker",
"vscjava.vscode-java-pack"
],
"settings": {}
}
"settings": {
"java.compile.nullAnalysis.mode": "automatic"
}
},
"features": {
"ghcr.io/devcontainers/features/git:1": {}
},
"forwardPorts": [8080],
"postCreateCommand": "java -version"
}
}
252 changes: 126 additions & 126 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,126 +1,126 @@
# 🔧 dataLib
**Minecraft Java Edition 26.2 | Multiplayer-Safe | Pure Datapack**

---
> Current version: **v6.0.0**
---

---
> 🛡️ **This is a Minecraft Datapack — it contains no executables or scripts outside of `.mcfunction` files.**
> Some antivirus software may flag `.mcfunction` files as suspicious due to macro-like syntax. This is a **false positive**. The pack has been scanned on [VirusTotal](https://www.virustotal.com) and returned clean.
> **Only download from this official repository.** Do not trust redistributed or repackaged versions from third-party sources.

---

## 📦 Installation

```
1. Place dataLib-v6.0.0 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
```

---

## 🏗️ Storage Architecture

```
datalib:engine (persistent data)
├── global
│ ├── version: "v6.0.0"
│ └── 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)
```

---

## 🔍 Predicate Reference

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](../../wiki/Predicate-Reference)

---

## 📦 Dependencies

### Lantern Load
**Repository:** https://github.com/LanternMC/load
**License:** BSD 0-Clause (public domain)

Provides deterministic load order, version tracking, and pre/load/post-load hooks.

```mcfunction
# 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 → v6.0.0 = 50000)
scoreboard players get dataLib load.status
```

### StringLib
**Repository:** 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`.

```mcfunction
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"
```


## 💬 Support

[![Issues](https://img.shields.io/github/issues/runtoolkit/DataLib-next?style=for-the-badge)](https://github.com/runtoolkit/DataLib-next/issues)
[![Discussions](https://img.shields.io/github/discussions/runtoolkit/DataLib-next?style=for-the-badge&logo=github&color=blue)](https://github.com/runtoolkit/DataLib-next/discussions)

---

*dataLib v6.0.0 | MC Java 26.2 | Pure Datapack*
# 🔧 dataLib
**Minecraft Java Edition 26.2 | Multiplayer-Safe | Pure Datapack**
---
> Current version: **v6.0.0**
---
---
> 🛡️ **This is a Minecraft Datapack — it contains no executables or scripts outside of `.mcfunction` files.**
> Some antivirus software may flag `.mcfunction` files as suspicious due to macro-like syntax. This is a **false positive**. The pack has been scanned on [VirusTotal](https://www.virustotal.com) and returned clean.
> **Only download from this official repository.** Do not trust redistributed or repackaged versions from third-party sources.
---
## 📦 Installation
```
1. Place dataLib-v6.0.0 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
```
---
## 🏗️ Storage Architecture
```
datalib:engine (persistent data)
├── global
│ ├── version: "v6.0.0"
│ └── 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)
```
---
## 🔍 Predicate Reference
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](../../wiki/Predicate-Reference)
---
## 📦 Dependencies
### Lantern Load
**Repository:** https://github.com/LanternMC/load
**License:** BSD 0-Clause (public domain)
Provides deterministic load order, version tracking, and pre/load/post-load hooks.
```mcfunction
# 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 → v6.0.0 = 50000)
scoreboard players get dataLib load.status
```
### StringLib
**Repository:** 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`.
```mcfunction
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"
```
## 💬 Support
[![Issues](https://img.shields.io/github/issues/runtoolkit/DataLib-next?style=for-the-badge)](https://github.com/runtoolkit/DataLib-next/issues)
[![Discussions](https://img.shields.io/github/discussions/runtoolkit/DataLib-next?style=for-the-badge&logo=github&color=blue)](https://github.com/runtoolkit/DataLib-next/discussions)
---
*dataLib v6.0.0 | MC Java 26.2 | Pure Datapack*
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,34 @@ jobs:
retention-days: 14
if-no-files-found: error

build-mod:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v7
- name: Repo lock
run: |
if [ "$GITHUB_REPOSITORY" != "runtoolkit/dataLib-next" ]; then
echo "::error::This workflow may only run in runtoolkit/dataLib-next."
exit 1
fi
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
- name: Make gradlew executable
run: cd dataLib-MOD && chmod +x gradlew
- name: Build Mod
run: cd dataLib-MOD && ./gradlew build --stacktrace
- name: Upload mod artifact
uses: actions/upload-artifact@v7
with:
name: dataLib-mod
path: dataLib-MOD/build/libs/*.jar
retention-days: 14
if-no-files-found: error

release:
needs: build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -184,7 +212,7 @@ jobs:
# ──────────────────────────────
summary:
runs-on: ubuntu-latest
needs: [lint, build, release]
needs: [lint, build, build-mod, release]
if: always()
steps:
- name: Generate Summary
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ rad.json
*.bclicense
*.flf
#Test results file
TestResults.xml
TestResults.xml
dataLib-MOD/.gradle
dataLib-MOD/build
dataLib-MOD/run
Loading
Loading