DPlib
⚪ Last updated 2023Preview

🔍 Analysis
- 🏆 #1492 of 2046 datapack mods in this game by downloads
📋 About This Mod
!(https://i.imgur.com/5Niiqn0.png) The complete documentation can be found (https://github.com/Z0rillac/DPlib/blob/main/DOCS.md) # Datapack library DPlib is a library for datapack developed in mcfunction. It is designed so that you can directly include the module you want in your datapack, without worrying about performance or compatibility and without creating dependencies. It is designed for performance and simplicity, it can be used in any datapack requiring simple or complex functions while being as fast as possible. This library contains: - dplib.math - Number-theoretic and representation - Power and logarithm - Trigonometry - RNG and LCG - Other various functions - dplib.datetime - Real world date and time - Local time - Time and duration calculation - Time conversion - dplib.threading - Code threading with contextual entities - Hierarchical threading - Scoreboard ID - dplib.benchmark - Benchmarking for development only ## How it works You just need to import the module(s) you need (they work independently) into the data folder of your datapack, you then need to load it by executing this command at the beginning of your datapack load file : ``` function dplib.<module>:load ``` You may also need to tick the module, if so add this to the beginning of your tick file : ``` function dplib.<module>:tick ``` To ensure proper de-installation, you must include this line in the uninstallation file : ``` function dplib.<module>:uninstall ``` In general, the input scoreboard for parameters is `dplib.<module>.in` and the output scoreboard is `dplib.<module>.in`. The automatically managed variables are in `dplib.<module>.main` For example, you can calculate how far away the nearest cow is: ```mcfunction # Puts the player's coordinates in parameters of the function execute as Someone store result score $x1 dplib.math.in run data get entity @s Pos execute as Someone store result score $y1 dplib.math.in run data get entity @s Pos execute as Someone store result score $z1 dplib.math.in run data get entity @s Pos # Puts the nearest cow coordinates in parameters of the function execute at Someone as @e store result score $x2 dplib.math.in run data get entity @s Pos execute at Someone as @e store result score $y2 dplib.math.in run data get entity @s Pos execute at Someone as @e store result score $z2 dplib.math.in run data get entity @s Pos # Calculates the distance using a tool provided by this library function dplib.math:tools/distance # Displays the result above the player's hotbar title Someone actionbar ``` Or you can simply get the real world timestamp live: ```mcfunction scoreboard players get unix_timestamp dplib.datetime.main ``` This library is made to be used with (https://marketplace.visualstudio.com/items?itemName=SPGoding.datapack-language-server) extension, it is easier to find the functions thanks to the auto completion provided by the extension and a library of aliases. The complete documentation can be found (https://github.com/Z0rillac/DPlib/blob/main/DOCS.md) It is advisable to credit the project : ``` This datapack uses DPlib https://github.com/Z0rillac/DPlib ```
!(https://i.imgur.com/5Niiqn0.png)
The complete documentation can be found (https://github.com/Z0rillac/DPlib/blob/main/DOCS.md) # Datapack library DPlib is a library for datapack developed in mcfunction. It is designed so that you can directly include the module you want in your datapack, without worrying about performance or compatibility and without creating dependencies. It is designed for performance and simplicity, it can be used in any datapack requiring simple or complex functions while being as fast as possible.
This library contains: - dplib.math - Number-theoretic and representation - Power and logarithm - Trigonometry - RNG and LCG - Other various functions - dplib.datetime - Real world date and time - Local time - Time and duration calculation - Time conversion - dplib.threading - Code threading with contextual entities - Hierarchical threading - Scoreboard ID - dplib.benchmark - Benchmarking for development only
## How it works
You just need to import the module(s) you need (they work independently) into the data folder of your datapack, you then need to load it by executing this command at the beginning of your datapack load file :
```
function dplib.
To ensure proper de-installation, you must include this line in the uninstallation file :
```
function dplib.
In general, the input scoreboard for parameters is `dplib.
For example, you can calculate how far away the nearest cow is: ```mcfunction # Puts the player's coordinates in parameters of the function execute as Someone store result score $x1 dplib.math.in run data get entity @s Pos execute as Someone store result score $y1 dplib.math.in run data get entity @s Pos execute as Someone store result score $z1 dplib.math.in run data get entity @s Pos # Puts the nearest cow coordinates in parameters of the function execute at Someone as @e store result score $x2 dplib.math.in run data get entity @s Pos execute at Someone as @e store result score $y2 dplib.math.in run data get entity @s Pos execute at Someone as @e store result score $z2 dplib.math.in run data get entity @s Pos # Calculates the distance using a tool provided by this library function dplib.math:tools/distance # Displays the result above the player's hotbar title Someone actionbar [{"text":"Nearest Cow : ","color":"red"},{"score":{"name":"$out","objective":"dplib.math.out"},"color":"yellow"},{"text":"m","color":"yellow"}] ```
Or you can simply get the real world timestamp live: ```mcfunction scoreboard players get unix_timestamp dplib.datetime.main ```
This library is made to be used with (https://marketplace.visualstudio.com/items?itemName=SPGoding.datapack-language-server) extension, it is easier to find the functions thanks to the auto completion provided by the extension and a library of aliases.
The complete documentation can be found (https://github.com/Z0rillac/DPlib/blob/main/DOCS.md)
It is advisable to credit the project : ``` This datapack uses DPlib https://github.com/Z0rillac/DPlib ```
📊 Mod Details
- Game
- Minecraft Data Packs
- Author
- Zorillac
- Version
- v1.2.1
- Downloads
- 288
- Endorsements
- 5
- Category
- datapack
- Created
- 5/21/2023
- Updated
- 5/19/2023
- Game Versions
- 1.19.4
- Tags
- library
🔧 How to Install Minecraft Data Packs Mods
Download from Modrinth. Use Prism Launcher or drop into your mods folder.
📖 Full step-by-step install guide for Minecraft Data Packs →
Visit the official mod page for specific installation instructions for this mod.
🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Data Packs commands, item IDs, and more.
❓ Frequently Asked Questions
Which Minecraft Data Packs versions does DPlib support?
The author lists 1.19.4. Other versions may work but are untested by the author.
What is the latest version of DPlib?
Version v1.2.1, published 2023-05-19 with 288 downloads recorded at the source.
Keep browsing — more Minecraft Data Packs mods await