A simple Fabric mod that lets players teleport back to their death location with the /deathback command. It automatically finds a safe spot if the player died in lava, fire, cactus, void, or other dangerous places.
It can be installed on the server or client:
- Install on the server if you want all players to be able to use the command in multiplayer
- Install on the client for single-player functionality
- Die in the game. Your death location is automatically recorded.
- Use
/deathbackto teleport back to a safe location near where you died.
If the exact death location is unsafe (e.g., lava, fire, void), the mod will search nearby for a safe spot to place you.
| Development Version | Compatible Versions |
|---|---|
| 1.20 | 1.20 - 1.20.6 |
| 1.21 | 1.21 - 1.21.1 |
| 1.21.2 | 1.21.2 - 1.21.8 |
| 1.21.9 | 1.21.9 - 1.21.11 |
| 26.1 | 26.1 - 26.2 |
- Java 25 or higher
- (Optional) Java IDE with Manifold support (e.g., IntelliJ IDEA) * If using IntelliJ IDEA, the Manifold plugin should be installed
Set minecraft_version in gradle.properties, or append -Pmc=x.x.x parameter to Gradle commands (e.g., ./gradlew build -Pmc=1.21) to switch Minecraft versions for development.
Note for IDE users:
After modifying gradle.properties or ./properties/*.properties, remember to reload the Gradle project (or click "Load Gradle Changes" button).
Cross-version Testing
To test mod compatibility with newer Minecraft versions:
-
Method 1:
- Set
minecraft_versionto target version, and configure matchingtest_fabric_api_version(e.g.,0.145.1+26.1) - Reload project to download dependencies (for IDE users)
- Place additional test mods in
./run/mods - Run Gradle task
runClientorrunServer(May encounter unexpected launch issues - if this occurs, try Method 2)
- Set
-
Method 2: Build JAR file and deploy to
modsfolder of the target Minecraft version client/server
Note:
The minecraft_version can be a version not explicitly listed in ./properties/*.properties files. The settings.gradle script will automatically select the nearest compatible properties configuration.
Run one of the following commands to build the JAR:
# Build the JAR for the currently configured Minecraft version
./gradlew build # Windows: .\gradlew build
# Build for a different Minecraft version, e.g.
./gradlew build -Pmc=1.21
To build JARs for all Minecraft versions defined in ./properties:
./gradlew buildAll # Windows: .\gradlew buildAll
Note:
All compiled JARs are output to ./build/libs.
This project is available under the CC0-1.0 license. Feel free to learn from it and incorporate it in your own projects.