SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
✓ VerifiedLibraries & compatibility

datapack function library

by white_elephant · for Minecraft

This data pack provides developers with some useful functions and is compatible with all versions of Minecraft (except for those versions where data packs cannot be installed).

40KDownloads
4d agoLast updated
LGPL-3.0-or-laterLicense
Data pack · Fabric +3Loaders

About datapack function library

From Modrinth

This data pack provides developers with some useful functions and is compatible with all versions of Minecraft (except for those versions where data packs cannot be installed).

中文介绍:GitHub | MC 百科

Preface

This datapack is licensed under the GNU LESSER GENERAL PUBLIC LICENSE.

This datapack provides developers with some practical functions (and some dialogs), compatible with all versions of Minecraft (except for versions that cannot install datapacks).

However, due to the large number of commands involved in the datapack, lower versions may not be able to use all functions. The applicable versions of all functions will not be specified below.

Please install the resource pack at the same time to use localized content (v3.2+). Otherwise, the datapack language will default to zh_cn.

The mod version of this datapack is packaged through Modrinth, and the content is exactly the same as the datapack version, but it is not necessarily the latest version. Please try to use the datapack version.

This datapack provides a dfl:dfl_enable function, which sets the score of the player dfl_enable in the dfl_scoreboard scoreboard item to 1, which is convenient for datapacks or mods that depend on this datapack to detect whether this datapack is loaded.

Example:

#Execute when the datapack is loaded:
scoreboard objectives add dfl_scoreboard dummy
scoreboard players set dfl_enable dfl_scoreboard 0
#If not loaded:
function dfl:dfl_enable
execute unless score dfl_enable dfl_scoreboard matches 1
#If loaded:
function dfl:dfl_enable
execute if score dfl_enable dfl_scoreboard matches 1

Note: Some functions have "prerequisite functions" attached to their usage. These functions must be executed once before executing them.

Some function usages are followed by {xx:"xx"}. These functions are macro functions. When using them, you need to pass parameters through {<parameter name>:"<content>"} (the parameters in the usage are the recommended parameters tested by the author during development, or the parameters used by the author for testing). The parameter name (such as num) is expressed as: {num} in the text. The parameter format can refer to the function usage, and special formats will be explained.

If you encounter any problems, please click here to give feedback.


Function Description

Start

Functions in this category are recommended to be executed when the datapack is loaded (reloaded).

Disable Special Damage

Function usage: /function dfl:start/disable_special_damage

  • Fall damage;
  • Fire damage;
  • Freeze damage;
  • Drowning damage.

Fix the respawn point to 0 0

Function usage: /function dfl:start/set_world_spawn

  • Set the world respawn point to 0 0 0;
  • Set the respawn point radius to 0;
  • At this time, the player will be fixed to respawn on the highest block at coordinate 0 0.

Enable death leaderboard

Function usage: /function dfl:start/show/enable_death_scoreboard

  • Create a scoreboard item named death;
  • The number of deaths will be displayed on the right side of the screen;
  • The number of player deaths is sorted from high to low;
  • Note: The death leaderboard will not be displayed when it is first enabled, and it will be displayed only after any player dies.

Display player health

Function usage: /function dfl:start/show/display_health_below_name

  • Create a scoreboard item named health;
  • The player's health will be displayed below the player's ID;
  • It will not be displayed if the distance is slightly far (only the player's ID is displayed);
  • Note: When it is first enabled, the health will be displayed as 0, and it will be displayed only after the value is updated (such as being injured).

Display player experience level

Function usage: /function dfl:start/show/display_level_in_tab

  • Create a scoreboard item named level;
  • The experience level of each player will be displayed in the Tab bar (player list bar);
  • Note: When it is first enabled, the experience level will be displayed as 0, and it will be displayed only after the value is updated (such as leveling up).

Display player health bar

Function usage: /function dfl:start/show/display_health_in_tab

  • Create a scoreboard item named health;
  • The health bar of each player will be displayed in the Tab bar (player list bar).
  • The effect is as follows:

![[DFL] Datapack Function Support Library (datapack function library)-Image 1](https://raw.githubusercontent.com/TouchController/E1epack/main/subprojects/datapack-function-library/README/Scoreboard_Display_List_Hearts.gif)

Quickly create a new team

Function usage: /function dfl:start/create_teams {team_blue:"blue",team_red:"red",prefix_blue:"blue",prefix_red:"red"}

  • Create two teams named {team_blue} and {team_red};
  • The colors are blue and red respectively;
  • Disable friendly fire for players in the same team;
  • Players can only collide with entities not on the same team;
  • The player name prefixes are {prefix_blue}_ and {prefix_red}_ respectively.

Tick

Functions in this category are recommended to be executed every Tick.

Soft ban player

Function usage: /function dfl:tick/soft_ban_player {title:"Ban Reason",subtitle:"Note"}

  • Note: The executor of this function must be the player to be banned, you can use the /execute command;
  • Realize a soft ban by continuously tp the player to 0 0 0, setting the mode to adventure, and continuously giving the player negative buffs;
  • Must be executed every Tick;
  • Title is {title}, subtitle is {subtitle};
  • Example: /execute as @a[tag=ban] run function dfl:tick/soft_ban_player {title:"Ban Reason",subtitle:"Note"}.

The effect is as follows:

Read the full description on Modrinth →

Highlights

From source data

Game versions

Supports 51 Minecraft versions, the newest being 26.3.

Loaders

Runs on Data pack, Fabric, Forge, NeoForge and Quilt.

Footprint

Rated a light load on a server.

What kind of mod it is

From the catalog
Listed on Modrinth as “Mods”

Libraries & compatibility

Foundations and fixes other mods build on. Usually installed because something else needs it.

Runs on your server

From source side support

Modrinth lists datapack function library as required on the server. Check its Modrinth page to see whether players need it too.

Compatibility

Game
Minecraft
Loaders
Data packFabricForgeNeoForgeQuilt
Runs on
Serverrequired on the server
Game versions
26.3 and 50 earlier

Verified at the source

  • ✓ModrinthOfficial listing, checked 2026-10-01Open ↗
  • ✓Authorwhite_elephant, as published on Modrinth
  • ✓LicenseLGPL-3.0-or-laterFree

datapack function library, answered

Generated from the mod’s own source data.

Do my players need to install datapack function library?

Modrinth lists datapack function library as required on the server. Check its Modrinth page to see whether players need it too.

Which loaders does it support?

Data pack, Fabric, Forge, NeoForge and Quilt.

Is it free?

Yes. datapack function library is free to download from Modrinth. Its license is LGPL-3.0-or-later.

How do I add it to my Nxeon server?

Use “Add to a server” on this page, or open NxLabs from your dashboard. We install it, restart your server and switch it on.

NxLabs

Run datapack function library on a Minecraft server.

Deploy in about a minute from $4.20 a month, then add datapack function library in one click.