COWMODSКаталог модов

DataPackPlus

Adds faster math commands, accessing entity variables, and other useful features for datapack developers.

Автор: JZalaOz874обновлён 14 июл. 2025 г.
БиблиотекиОптимизацияУтилиты

Описание


Logo

DataPackPlus (DP+)

A helpful Minecraft Fabric mod to improve the lives of data pack developers!

Report Bug · Request Feature

About the project

My friend Nedraw is a datapack developer, and we're working together on modding and datapack development. To help him out, I made an api for him, so he can make datapacks easier and with better performance.

I decided to open-source and publish this so I can help other people out.


Here are the features this mod adds.

  • /data math

This command allows you to do more complex and faster math operations.
Here are some examples on how to use the command:

/data math <operation> with <input_nbt> (Will just show the result in chat)
/data math <operation> storage <storage_identifier>
/data math <operation> storage <storage_identifier> <nbt_subpath>
  • /data variable

This command allows you to set and get specific variables for an entity. Here are some examples on how to use the command:

/data variable <add|set|get> <variable> (Will just show the result in chat if get)
/data variable <add|set|get> <variable> to <storage_identifier>
/data variable <add|set|get> <variable> to <storage_identifier> <nbt_subpath>
  • Ridable players

You can have entities mount and dismount onto players; the player being ridden cannot force the entity to dismount.

Example of using /data math (the NBT schema is the same for variable)

/data modify storage minecraft:test in set value [43,35] (Storage nbt: {in:[43,35]} )
/data math add storage minecraft:test (Storage nbt: {in:[43,35],out:[78.0d]})

Math operations

For all arithmetic operations, the input is an array of numbers of any size. If the size is more than 2, it will treat it as chaining the operations, for example, if it's an add operation with 4 inputs, it will sum it all up.

If you want to know what these operations are, just search for them.

Operation NameInput SizeNotes
add2
subtract2
multiply2
divide2
mod (modulo)2
negate1
factorial1
power (exponentiation)2
root (nth root)2
distance2input: [x,y,z], [x,y,z]
distance_squared2input: [x,y,z], [x,y,z]
rad2deg (radians→deg)1
deg2rad (degrees→rad)1
sin1
cos1
tan1
arcsin1
arccos1
arctan1
arctan22
ceil (round up)1
round1
floor (round down)1

Variable Types

Variable NameDescriptionTypeAccessors
motionThe entity's motion/velocity[double, double, double]Get, Set, Add
hungerThe entity's foodLevel/Hunger and Saturation[double (hunger), double (saturation) ]Get, Set, Add
healthThe entity's health[double (0 to 20.0) ]Get, Set, Add
held_slotThe player's selected hotbar slot[int (0 to 8) ]Get, Set, Add
fall_distanceHow far the entity has fallen, 0 if they are not falling[double]Get
dimensionThe entity's dimension/world with namespace[string]Get
positionThe entity's xyz position[double,double,double]Get, Set, Add
angleThe entity's yaw and pitch angle[double (yaw), double (pitch) ]Get, Set, Add

Последние версии

Все версии →
release

DataPackPlus 1.0.0

1.0.0
14 июл. 2025 г.82Minecraft: 1.21.7fabric
Скачать