🔨 DataHammer API
DataHammer API is a lightweight, high-performance developer framework built for Minecraft 1.20.6+. It removes the complexity of writing repetitive backend engine loops. Developers do not need to structure their own custom datapacks to mirror this framework; instead, they simply link into the installed DataHammer API folder on their machine or server to inject code directly into our system loops.
✨ Features
- Global Movement Dispatcher: Detects player states (walking, sprinting) and runs any custom function path you register inside our central event hook.
- Smart RNG Library: Efficient, unseeded pseudo-random number generation calculated through precise vector arithmetic, handling inputs and outputs inside our global data variables.
- Unified UI Pipeline: A conflict-free Actionbar interface renderer designed to prevent text layout clashing by taking custom strings directly inside the API's variables.
🛠️ Developer Documentation: How to Access & Inject Your Code
To utilize this API, locate the installed DataHammer folder on your development machine or server (for example, at C:\Users\user\desktop\datahammer_api\). You will inject your paths directly into our files.
1. Registering Your Functions inside the Movement Loop
To make your custom function run automatically whenever any player walks, you do not need to build independent event loops in your project. Simply navigate directly into the installed DataHammer API directory:
📁 .../datahammer_api/data/data_hammer/tags/functions/on_player_walk.json
Open that file and add your own custom namespace function path straight into the values array:
{
"values": [
"your_custom_namespace:your_walk_function"
]
}
2. Accessing the RNG Math Engine Variables
To generate a random bounded integer during any gameplay event, you only need to write your maximum boundary value straight into our data buffer registry, and then call our calculation method:
# Step 1: Write your upper limit directly into our data buffer variable (e.g., numbers up to 50)
data modify storage data_hammer:io random_max set value 50
# Step 2: Trigger our algorithm to calculate the result
function data_hammer:math/random
# Step 3: Read or test the final calculated value directly from our output variable
execute if data storage data_hammer:io {random_result: 7} run say Lucky Number 7 rolled!
3. Displaying Content with the UI Pipeline
To output customized text overlays without overlapping or breaking other active project integrations on the server, inject your custom strings into our framework's global interface storage variables:
# Step 1: Inject your custom identifier or title prefix into our text variable
data modify storage data_hammer:io ui_prefix set value "§c[YourMod]§r"
# Step 2: Inject your active message string right next to it
data modify storage data_hammer:io ui_message set value "§eMana: 100/100§r"
# Step 3: Run our pipeline manager to instantly merge, process, and display the text safely
function data_hammer:ui/display_actionbar
🔄 4. Renaming the Datapack Folder (Optional)
Once you have finished modifying all the functions and injecting your custom code inside the framework, you are completely free to rename the main datapack root folder (datahammer_api) to whatever you like (e.g., changing it to your own mod name like C:\Users\user\desktop\my_custom_mod).
Changing the folder's name will not break the internal system code, because all functions internally refer to the data_hammer: data namespace, which remains untouched regardless of the external folder name.
📜 License
This API is open-source. Feel free to embed it inside your own customized projects, provided credit is explicitly attributed back to DataHammer Framework.

