Damage Function
Damage Function is a Fabric library that lets a Minecraft datapack or command set damage to entities through a function, for a single entity or several at once.
What it does
Damage Function adds a function-based way to deal damage to entities in Minecraft Java Edition, with builds covering 1.17 – 1.18.1. The author describes the mod as finally making damage available as a function, so a datapack can apply it without a separate mod for each use. The mod is a library, which means it provides the mechanism and leaves the content to other mods or to a pack's own functions.
The mod works with one entity at a time and with several entities at once, so a function can target a single mob or a group of them. It runs on the server alone, so players join without installing anything and the server owner is the one who installs it. The source code and issue tracker are public.
Files are published for Fabric only, across four release versions: 1.17, 1.17.1, 1.18 and 1.18.1. The latest file is damagefunction-1.1 for 1.18.1, released on 2021-12-12. The mod was first published on 2021-09-05. It is open source under the MIT License.
Key features
Function-based damage
Damage is applied through a function, so a datapack can trigger it without a separate mod for each effect.
Single entity targeting
A function can damage one entity at a time, selected like any other target in a command.
Multiple entity targeting
A single function can damage several entities in one call, useful for area effects and groups of mobs.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Use cases
Datapack combat effects
Pack authors can write damage into their own functions, for example to hurt mobs that touch a trap block.
Server-side area damage
A server can damage a group of nearby entities at once through one function call.
Who it’s for: Datapack authors and server owners who want to deal damage through functions on Fabric for versions covered by the 1.17 – 1.18.1 builds. Players who only join a server do not need the mod.
How it compares
Data Overhaul is a Fabric option for 1.17.1 that is also server-side only, but it is published under a custom license and is not open source. Function Macro Backport is a server-side Fabric mod for 1.20.1 under the MIT License, so it targets a later version than Damage Function. VideoLib is client-side only on Fabric for 1.18.2 and does not run on the server.
| Mod | Loaders | Game versions | Environment | Updated |
|---|---|---|---|---|
| Damage Function | Fabric | 1.17 – 1.18.1 | Server-side only | 2021-12-12 |
| Data Overhaul | Fabric | 1.17.1 | Server-side only | 2021-07-20 |
| Function Macro Backport | Fabric | 1.20.1 | Server-side only | 2025-06-22 |
| VideoLib | Fabric | 1.18.2 | Client-side only | 2022-09-01 |
Questions
Does Damage Function need to be installed on the client?
Which loader and versions does Damage Function support?
Is the source code available?
In the catalog
Damage Function is one of 3,514 Library mods on ModsFinder, and one of 2,348 Library mods for Fabric. 4,416 mods support Minecraft 1.18.1.
Similar mods
What the author says
Where: - = entity (can be multiple) - = float - = identifier - = entity (singular)
Official listing
- Modrinth page
- modrinth.com/mod/damagefunction
- Owner
- andrewtoaster
- Published
- 2021-09-05
- Updated on Modrinth
- 2021-12-12
- Facts verified
- 2026-10-15
