Utils

Utils

Utility library

by
3.8K Downloads
datapackfabricforgeneoforgequiltlibraryutility
Rent Server with this Mod

About this Mod

Utils

Version: 5

Features

  • Global, Entity and Player Functions
  • Motion Entity in Facing Direction
  • Data Storage by Entity
  • Consts Scores
  • Player Score ID
  • Predicates
  • Item Modifiers
  • Entity Tags
  • Macro Functions
  • Custom Use Remainder

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

  • can/see_sky
  • has/effect/<effect_name> (speed, regeneration, ...)
  • has/passenger
  • in/biome/<biome_name>
  • in/structure/<structure_name> (village, desert_pyramid, trial_chambers, ...)
  • in/dimension/<dimension_name> (overworld, the_nether, the_end)
  • in/light/<level> (0, 5, 10, 15, 0-5, 5-10, ...)
  • is/raining
  • is/thundering
  • is/baby
  • is/falling
  • is/flying
  • is/ground
  • is/on_fire
  • is/riding
  • is/sneaking
  • is/sprinting
  • is/swimming
  • random/<chance> <0.1 (10%), 0.5 (50%), ...>

Example:

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

Item Modifiers

  • count
    • count/add/<number>
    • count/remove/<number>
    • count/set/<number>
  • enchantment_glint_override/<boolean>
  • max_stack_size/<number>
  • rarity/<rarity_name>
  • remove_component/<item_component_name> (use_cooldown, enchantments, max_stack_size, ...)
  • repair_cost/<number>
  • tooltip/<tooltip_name>/<show | hide>
  • use_cooldown/<time> (1s, 2s, 1m, 1h, ...)
  • damage
    • damage/add/0.<number>
    • damage/set/0.<number>
  • clear_bundle
  • clear_container
  • death_protection
  • enchant_randomly_compatible
  • enchant_randomly
  • furnace_smelt
  • glider
  • hide_additional_tooltip
  • hide_tooltip
  • non_consumable
  • one_use
  • remove_container_loot
  • repair
  • unbrekeable

Example:

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

Entity Tags

  • all_boats
  • animals
  • aquatics_animals
  • aquatics_real_animals
  • aquatics
  • arthropods
  • boats_with_chest
  • boats
  • bosses
  • cows
  • end
  • fishs
  • flyers_hostiles
  • flyers
  • horses
  • hostiles
  • humanoids
  • illagers
  • monsters
  • nether
  • neutrals
  • passives
  • piglins
  • proyectiles
  • real_animals
  • rideables_animals
  • rideables
  • slimes
  • spiders
  • tameables
  • undead
  • villagers_hostiles
  • villagers
  • zombiess
  • team_player

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.

Interested? Then we've got a deal for you!

!

Available Versions

v7.0.0release
MC 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8fabric, forge, neoforge, quilt
March 26, 2025
v7.0.0release
MC 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8datapack
March 26, 2025
v5.0.1release
MC 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4datapack
February 18, 2025
v5.0.0release
MC 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4fabric, forge, neoforge, quilt
February 16, 2025
v5.0.0release
MC 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4datapack
February 16, 2025

How to Install Utils on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set datapack Loader

In the panel under "Egg", select the datapack loader and matching Minecraft version (1.21.8).

3

Install Mod

Open the mod browser in the dashboard and search for "Utils". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

datapackfabricforgeneoforgequilt

Minecraft Versions

1.21.8, 1.21.7, 1.21.6 (+6 more)

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Utils server crashes on startup – what to do?

Most common cause: wrong datapack version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.8). You can switch loaders with one click in the panel.

Is Utils compatible with datapack and fabric and forge and neoforge and quilt?

Utils officially supports datapack, fabric, forge, neoforge, quilt for Minecraft 1.21.8, 1.21.7, 1.21.6. Note: Forge and Fabric mods are NOT cross-compatible – pick one loader and stick with it. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Utils – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Utils consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Utils with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Required

Supported Versions

1.21.81.21.71.21.61.21.51.21.41.21.31.21.21.21.11.21