Compatibility
Minecraft: Java Edition
Platforms
Links
Tags
Creators
Details
Antighost
Lightweight Paper plugin that prevents death by consuming a Totem of Undying and applying safe effects.
Overview
This repository contains a small Minecraft Paper plugin written in Java. The plugin listens for lethal damage and consumes a Totem of Undying (main/off-hand) to keep the player alive while playing the totem effects.
Key files:
src/main/java/.../Antighost.java- plugin main classsrc/main/java/.../listeners/TotemListener.java- main listener implementationsrc/main/resources/paper-plugin.yml- Paper plugin descriptor (will be packaged into the JAR)build.gradle- Gradle build configuration
Requirements
- JDK 17+ (project is configured to target Java 21 in
build.gradle; ensure your toolchain supports it) - Gradle (the project includes the Gradle wrapper; you can run
./gradlewon Unix or. gradlew.baton Windows)
Build
From the project root (Windows PowerShell):
# Clean and build the plugin
.\gradlew.bat --no-daemon clean build
After a successful build the plugin JAR will be in build/libs/ (for example build/libs/antighost-1.0-SNAPSHOT.jar).
Verify the plugin descriptor is packaged (important for Modrinth)
Modrinth (and Paper) requires a plugin.yml or paper-plugin.yml at the root of the plugin JAR. If Modrinth gives the error "No plugin.yml or paper-plugin.yml present for plugin file" the YAML is missing from the artifact.
Use one of these commands in PowerShell to check the contents of the built JAR:
# Find the latest built jar
$jar = Get-ChildItem .\build\libs\*.jar | Select-Object -Last 1 -ExpandProperty FullName
# List entries and search for plugin descriptor names
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::OpenRead($jar).Entries | Select-Object -ExpandProperty FullName | Where-Object { $_ -match 'plugin.yml|paper-plugin.yml' }
If the command prints paper-plugin.yml (or plugin.yml), it is present. It must appear at the root of the JAR (the entry name should be exactly paper-plugin.yml or plugin.yml).
Alternative (using jar if available):
& 'C:\Program Files\Java\jdk-21\bin\jar.exe' tf build\libs\antighost-1.0-SNAPSHOT.jar | Select-String 'paper-plugin.yml|plugin.yml'
Common causes & fixes if the YAML is missing
- Resource file misplacement: ensure the descriptor is at
src/main/resources/paper-plugin.yml(orplugin.yml). build.gradlecustomizations: check forsourceSetsoverrides that excludesrc/main/resourcesorprocessResourcesfilters that unintentionally exclude*.yml.- Using a shading plugin (Shadow): ensure you upload the shaded JAR (usually
shadowJar) and that the shading configuration includessourceSets.main.outputso resources are bundled. - If you use
processResourcesto expand properties (this project uses it to expandversioninpaper-plugin.yml), make sure thefilesMatching('paper-plugin.yml')block is correct and not excluding the file.
Example Gradle hints (Groovy DSL):
- Ensure resources are included (default behavior):
sourceSets {
main {
resources.srcDirs = ['src/main/resources']
}
}
jar {
from(sourceSets.main.output)
}
- If you use Shadow plugin, ensure you publish the shadow jar:
shadowJar {
from(sourceSets.main.output)
}
tasks.build.dependsOn shadowJar
Troubleshooting steps
- Confirm the
paper-plugin.ymlexists atsrc/main/resources. - Run a clean build:
. gradlew.bat --no-daemon clean build. - Verify the JAR contents using the PowerShell snippet above.
- If missing, inspect
build.gradleforprocessResources,sourceSets,jar, orshadowJarblocks. - If you need help, open an issue or paste the output of
. gradlew.bat --no-daemon clean build --infoand the JAR listing command output.
License
MIT
If you'd like, I can also add a small CI workflow that builds the jar and checks the JAR contains paper-plugin.yml automatically on push.


