HomeJavaDatapacksUtils
Utils
DatapacksJava

Utils

by lullaby · on Modrinth

Which build do you need?

This mod ships a separate file for every mod loader and every version of the game. Pick both, then download — the wrong build installs fine and then does nothing in the game.

Mod loader

Minecraft version

⬇ Download for 1.21.1–1.21.8 · Data pack⬇ Download for 1.21.1–1.21.8 · Fabric⬇ Download for 1.21.1–1.21.8 · Forge⬇ Download for 1.21.1–1.21.8 · NeoForge⬇ Download for 1.21.1–1.21.8 · Quilt
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

Utils

Version: 5

Features

Commands

Global

Clear chat for all players:

/function utils:global/clear_chat

Hide sidebar:

/function utils:global/hide_sidebar

Entity

Despawn an entity/mob:

/execute as @n[type=zombie] run function utils:entity/despawn

Reset entity/mob/player all attributes:

/execute as @n[type=zombie] run function utils:entity/reset_all_attributes

Heal full:

/execute as @n[type=iron_golem] run function utils:entity/heal_full

Player

Clear chat for player:

/function utils:player/clear_chat

Reset XP (points and levels):

/function utils:player/xp/reset

Get all XP Points:

/function utils:player/xp/get_all_points

The function return the all xp points and they are saved in the score utils.player.xp.total_points

Random TP for voids worlds:

/function utils:player/random_tp

Motion

function utils:motion/calc

summon fireball ^ ^ ^.5

execute store result entity @n[type=fireball] Motion[0] double -0.00025 run scoreboard players get @s utils.motion.mx
execute store result entity @n[type=fireball] Motion[1] double -0.00025 run scoreboard players get @s utils.motion.my
execute store result entity @n[type=fireball] Motion[2] double -0.00025 run scoreboard players get @s utils.motion.mz

or you can use the Storage and Macro method:

function utils:motion/storage {"value":"-0.00025"}

summon fireball ^ ^ ^.5

data modify entity @n[type=fireball] Motion set from storage utils:motion motion

Data Storage by Entity

Create data

Exist two ways to create or add data to a path, set and append, when you use set, the absolute value of the path will be the data arg, and for append, the path will be an array, and will append the data arg.

# absolute
/function utils:entity/storage/set {"path":"lives","data":3}
/function utils:entity/storage/set {"path":"name","data":'"lullaby6"'}

# array
/function utils:entity/storage/append {"path":"deaths","data":1}
/function utils:entity/storage/append {"path":"deaths","data":2}
/function utils:entity/storage/append {"path":"deaths","data":3}

Run function with Entity's data

When you use the entity/storage/function all data/args from entity's storage will be received to the function like macro args.

/function utils:entity/storage/function {"function":"namespace:say_lives"}

say_lives.mcfunction file:

$say $(lives)

Remove data

# absolute
/function utils:entity/storage/remove/data {"path":"lives"}
/function utils:entity/storage/remove/data {"path":"name"}

# array
/function utils:entity/storage/remove/first {"path":"deaths"}
/function utils:entity/storage/remove/index {"path":"deaths","index":1}

Consts

There are constants from 0 to 1000.

You can check and get the const value running this command:

/scoreboard players get <number> utils.const

Usage example:

/scoreboard players get 1 utils.const

Player Score ID

Get the player score ID:

/scoreboard players get @s utils.player.id

Predicates

Example:

/execute as @s if predicate utils:is/on_fire run say I am on fire D:

Item Modifiers

Example:

/execute if items entity @s weapon.mainhand minecraft:raw_iron run item modify entity @s weapon.mainhand utils:furnace_smelt

Entity Tags

Example:

/effect give @e[type=#utils:team_player] glowing 1 0

License

MIT

🎁 Server Hosting

Creating your own server can be a very lengthy, tedious and costly process.

But with BisectHosting, you get your own server in just a couple of clicks! With their 24/7 support and fast-response time, no issues shall stand in your way! Interested? Then we've got a deal for you!

https://bisecthosting.com/lullaby

Server Hosting

Quick facts

Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more