Lots of changes have been happening recently that has made it difficult for me to support many versions with a single mod jar, so if you need support for a version, make an issue on github and I'll make a branch that supports your version. Otherwise, I will only be otherwise officially supporting the latest version of Minecraft.
Andrew's Datapack Utils is a Fabric/NeoForge/Forge/Paper Mod aimed at creating useful utilities for datapacks (mainly for datapack functions). It adds a command which holds most of the utilities, and allows modification of player data using /data and /execute store, allowing for easy manipulation of players and allows for things that were previously impossible.
/aputils calc <add|sub|mul|div|power|sqrt|...> command. Works great with /execute store result and function macroes./aputils calc distance <pos 1> <pos 2> or /aputils calc distance entities <selector1> <selector2>/aputils calc distance entities, for blocks use /aputils calc distance (notice the lack of entities)/data or /execute store (result|success) entity to change player entity data, it just throws an error, Unable to modify player data, and doesn't change anything. With this mod, that restriction is removed, allowing for easy modification of player entity data. Note that not everything can be modified, attempting to change certain values such as Motion or Pos does nothing. Use other commands such as /aputils velocity or /tp to change these instead./aputils velocity <xyz> [add|set|multiply]
/aputils attack_cooldown <player>
/execute store result./aputils despawn <entities> [force]
force isn't applied and the target selecter includes one or more players at the time of the command being run (not if the selector allows players), the command fails.force is included/aputils check_damage <entity> [type]
/aputils pathfind <entity: selector> <xyz: Vec3d> [speed: double] or /aputils pathfind <entity: selector> entity <target: selector> [speed: double]
/aputils target <entity> <target>
/aputils heartbeat, which always outputs 1 to /execute store result.
Datapacks can detect if the NeoForge or Fabric version of the mod is being used with /aputils version. Returns 1 if NeoForge is being used and 0 if Fabric is being used.This can be included in any modpack without my permission.
If you want to port this to Forge, go ahead.
Any contributions would be greatly appreciated!
This is the first actual mod I've made in my entire history of Minecraft development. Before this I've only ever made datapacks for minecraft.
It's always bothered me that I can't get the full features of some of my datapacks (like Old Combat Datapack) on a plugin-based server software like Paper due to ADPU not being a Plugin, so I decided to teach myself paper, and now ADPU for Paper is officially in the works! It's important to note that stuff like player data modification and damage checking will not be available due to mixins not being a thing on paper, so be prepared for that. Workarounds will be available though with a work in progress "aputils manipulate" command that will be available on all loaders and will be able to do stuff like modify health-based and hunger-based values, among other things.
Useful utilities for datapacks, such as a calculator and allowing player data modification, and more.