Skip to content

datapack function library für Minecraft 1.20.1, 1.21.1

Dieses Datenpaket bietet Entwicklern einige nützliche Funktionen und ist mit allen Versionen von Minecraft kompatibel (außer mit den Versionen, in denen Datenpakete nicht installiert werden können).

Auf den Server
Aufrufe
36 Aufrufe
Aktualisiert
Aktualisiert 27.09.2026

Über das datapack function library-Datenpaket

中文介绍: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 {:""} (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:

![[DFL] Datapack Function Support Library (datapack function library)-Image 2](https://raw.githubusercontent.com/TouchController/E1epack/main/subprojects/datapack-function-library/README/tick.ban.png)

Beacon elytra take-off

Function usage: /function dfl:tick/beacon_fly

  • When there are iron blocks, gold blocks, emerald blocks, diamond blocks or netherite blocks under the beacon, the player will be teleported upwards (spectators will not be teleported);
  • The heights are 20, 40, 60, 80, and 100 blocks in order;
  • The same blocks can be stacked to increase the height (the highest is 400 blocks, using four netherite blocks). If the blocks are different, the block closest to the beacon will be used.

One-click negative Buff

Function usage: /function dfl:tick/apply_debuffs

Give the function executor the following Debuffs:

  • slowness
  • mining_fatigue
  • nausea
  • darkness
  • hunger
  • weakness
  • poison
  • unluck
  • trial_omen

Iron block elevator

Function usage: /function dfl:tick/iron_block_elevator

  • Teleport the player upwards when standing between two iron blocks, one above the other;
  • The maximum teleportation distance is 6 blocks, that is, the maximum distance between two iron blocks is 5 blocks;
  • Will not teleport spectators;
  • Will teleport creatures and non-creature entities.

Clear entities if there are too many

Function usage: /function dfl:tick/kill_excess_entities {num:"1000"}

  • Clear all non-player entities when the number of non-player entities is greater than {num};
  • Will not clear entities with the need tag;
  • Entities with the need tag will not be counted in the number of entities here;
  • Create a scoreboard item named dfl_scoreboard.
  • After execution, a prompt will be displayed in the chat bar, the effect is as follows:

![[DFL] Datapack Function Support Library (datapack function library)-Image 3](https://raw.githubusercontent.com/TouchController/E1epack/main/subprojects/datapack-function-library/README/tick.kill.png)

Clear entities if the entity density is too high

Function usage: /function dfl:tick/kill_by_density {num:"50"}

Prerequisite function: /function dfl:lib/get_entity_density

  • Make all entities clear these entities when the number of entities within 10 blocks is greater than {num};
  • Will not kill players;
  • Will not kill villagers;
  • Will not kill entities with the need tag;
  • Will not leave traces in the chat bar.

Minecraft is too hard

Function usage: /function dfl:tick/mith

  • Enable keep inventory on death;
  • Give the executor night vision;
  • Give the executor glowing;
  • Remove the executor's darkness effect.

Display the number of entities

Function usage: /function dfl:tick/display_entity_count

Prerequisite function: /function dfl:lib/get_entity_count

  • Display the real-time number of entities in the player's action bar (above the shortcut bar).
  • The effect is as follows:

![[DFL] Datapack Function Support Library (datapack function library)-Image 4](https://raw.githubusercontent.com/TouchController/E1epack/main/subprojects/datapack-function-library/README/tick.show_entity.png)

Disable player friendly fire and collision

Function usage: /function dfl:tick/disable_friendly_fire

  • Add a team named dfl and add all players to this team;
  • Note: Since the same entity cannot join multiple teams, please do not enable this function if you want to use the player team function;
  • Disable team friendly fire;
  • Disable collision within the team;
  • If this function is not run every Tick, please make sure to run this function once after each new player joins.

Clear TNT if the TNT entity density is too high

Function usage: /function dfl:tick/kill_tnt_by_density {num:"200"}

  • Clear these TNT entities when the number of TNT entities within five blocks of the TNT is greater than {num};
  • Create a scoreboard item named dfl_tntdensity.

Suicide for players without permission

Function usage: /function dfl:tick/trigger_suicide

  • Create a scoreboard item named kill;
  • Enter /trigger kill to commit suicide (this command does not require any permission).

Replace blocks in a large area

Function usage: /function dfl:tick/change_block {new:"glass",old:"stone",num:"30"}

  • Replace {old} with {new} in a cube with a side length of {num}*2+1 centered on the command executor;
  • Change the game rule max_block_modifications to 2147483647.

Always day + always sunny

Function usage: /function dfl:tick/always_sunny

  • Turn off the day-night cycle;
  • Turn off weather changes;
  • Set the time to day;
  • Set the weather to clear.

Clear a single item and execute a command

Function usage: /function dfl:tick/clear_and_execute_single {namespace:"minecraft",name:"stone",run:"tp ~ 100 ~"}

  • Clear one {namespace}:{name} from all players and execute {run};
  • Note: There should be no extra spaces at the beginning and end of the command in the run parameter, and there should be no slash before the command.

Clear specified items and execute commands multiple times

Function usage: /function dfl:tick/clear_and_execute_multiple {namespace:"minecraft",name:"sand",run:"give @s anvil"}

  • Clear all {namespace}:{name} of the function executor and execute the corresponding number of {run} (within the same tick);
  • Note: There should be no extra spaces at the beginning and end of the command in the run parameter, and there should be no slash before the command.

Keep having an item

Function usage: /function dfl:tick/maintain_item_count {namespace:"minecraft",name:"slime_block",num:"64"}

  • Let the command executor have exactly the specified number of {namespace}:{name}.

Self-rescue platform

Function usage: /function dfl:tick/create_rescue_platform

Prerequisite function: /function dfl:lib/get_game_time

  • Create a scoreboard item named dfl_slime_marker_temp to store the time when the slime platform is generated;
  • Generate a 3*3 slime platform under the player with the dfl_slime tag and remove the tag. The slime platform can only cover air blocks;
  • The slime blocks at the slime platform position will be cleared after ticks;
  • The dfl_scoreboard scoreboard item of slime_time will be set to 200 when it is not assigned, which is 10s;
  • The slime block drops within 2 blocks of the player's position when the platform is generated will be cleared.

Installation von datapack function library

With Millida Launcher

  1. Install Millida Launcher

    The launcher is free: download it at millida.net/launcher and sign in with any nickname.

  2. Click “Install” on this page

    The launcher opens and installs the data pack for Minecraft 1.13–26.3 automatically, together with its dependencies: Dependency.

  3. Launch the game

    A profile with it appears in the launcher: click “Play”.

Manually

  1. Download the archive

    Pick the file datapack-function-library_v5.1.0_26.1-26.3.zip (164 KB) for your game version.

  2. New world: “Data Packs”

    When creating a world, click “Data Packs”, drag the archive into the window, then move it to “Selected”.

  3. Existing world: the datapacks folder

    Put the archive into saves/<world>/datapacks and type /reload in game.

On a server

  1. Archive goes into the server world’s datapacks

    The world/datapacks folder on the server; players do not need to install anything.

  2. Reload the data

    Type /reload in the server console or restart the server.

  3. Or use the “To hosting” button

    On Millida Hosting, the button at the top of the page uploads the file to your server and restarts it for you.

Versionen

Mit Abhängigkeiten

MinecraftLoaderDateiDatumAktionen
26.3Datenpaket26.3164 KB
1.21.11Datenpaket1.21.11164 KB
1.21.10Datenpaket1.21.10164 KB
26.3Datenpaket26.3163 KB
1.21.11Datenpaket1.21.11163 KB
1.21.10Datenpaket1.21.10163 KB
1.21Datenpaket1.21200 KB
1.20.1Datenpaket1.20.1200 KB

Was zum Ausführen nötig ist

  • Dependencyerforderlich

Inhalte, die dies benötigen

FAQ

Which Minecraft versions does datapack function library work on?

There are files for 1.13–26.3, 51 versions in total. The newest is 26.3.

Does datapack function library work on a server?

Yes: the data pack goes into the datapacks folder of the server world, and players do not need to install anything.

What does datapack function library need to work?

Required: Dependency. Without it the data pack will not start.

Where can I download datapack function library safely?

On this page: the file datapack-function-library_v5.1.0_26.1-26.3.zip (164 KB) is stored on Millida’s server, with no link shorteners. SHA-1 checksum: 3cf03ea40b61ee5f0bdfee8a5effea42b90d2cd0.

Bewertungen

Bewerten Sie datapack function library als Erster

Kommentare 0

Melden Sie sich an, um zu kommentierenAnmelden

Ähnliche Datenpakete

Alle Datenpakete

Mehr dazu

Autor: white_elephantLizenz: LGPL-3.0-or-laterQuellcode

Sind Sie der Autor? Schreiben Sie uns — wir entfernen es innerhalb von 48 Stunden.