nineMinecraft is a joke site.
nineMinecraft is in no way affiliated with Modrinth or 9minecraft. (And frankly, who wants to be affiliated with the latter?)

Andrew's Datapack Utils

Mod

Useful utilities for datapacks, such as a calculator and allowing player data modification, and more.

Server Game MechanicsLibraryManagementUtility

582 downloads
1 follower

Notices:

If the latest version (1.2.2) doesn't work on your game version, please use 1.2.2-hotfix (fabric only) or 1.2.1 as the features added in 1.2.2 can break older game versions. 1.2.2-hotfix fixes this issue by making the mixins that the pack uses 'optional', which means if they fail to load, it doesn't prevent the whole game from starting, and making features that use said mixins simply not work and always return 0.

The NeoForge version is lower priority and might recieve updates slower than the Fabric version. This is because it is difficult to maintain versions for 2 separate loaders at once, Fabric is just easier to code with, and working on the NeoForge version takes a little extra time that I might not have.

About

Andrew's Datapack Utils is a Fabric/NeoForge 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.

Features

  • Basic Math Calculation
    • used by using the /aputils calc <add|sub|mul|div|power|sqrt> command. Works great with /execute store result and function macroes.
  • Editing Player Data
    • Normally, you can't use /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 velociy <xyz> [add|set]
    • allows you to manipulate the velocity of entities in ways you can't with normal methods, such as modifying the velocity of players (you can't with a player data modification mod because it doesn't send the velocity update packet to the client)
    • requires permission level 2, meaning you nead cheats in a single player world or permission level 2 in a server
  • /aputils attack_cooldown <player>
    • Outputs the attack cooldown progress of the provided player, as a percent if using /execute store result.
  • aputils despawn <entities> [force]
    • Despawns one or more entities. Not the same as /kill, as this simply removes the entity/entities from your world without triggering any sort of death event, just silently removing the entity as if it despawned.
    • If 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.
    • Requires permission level 2, or permission level 4 if force is included
  • aputils check_damage <entity> [type]
    • Returns true if the entity took damage on the tick the command was run, and type isn't provided
    • Returns true if the entity took damage of the provided type on that tick, if type is provided.
    • Doesn't work on older game versions, oldest tested and working version is 1.21.2
      • This command always returns 0 if the required mixin doesn't load

Datapacks can detect if this mod is installed using /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.

Known Issues

  • Every time /aputils velocity is run, it prints "The new velocity is (x, y, z)" to the server console/game logs which can be annoying
    • This was a debugging feature that was left on accidentally and will be disabled next update.

Notes

This can be included in any modpack without my permission.

If you want to port this to Forge, go ahead.

To Developers

Any contributions would be greatly appreciated!

Fun Facts

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.

External resources


Project members

AndrewGaming587

Member


Technical information

License
CC-BY-4.0
Client side
unsupported
Server side
required
Project ID