AntiTotemGhost
PluginMIT

AntiTotemGhost

This plugin prevents client and server side totem ghosting. it will decrease the ghosting amount a lot.

68
Downloads
0
Followers
2 months ago
Updated
📦
1
Versions

📖About AntiTotemGhost

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 class
  • src/main/java/.../listeners/TotemListener.java - main listener implementation
  • src/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 ./gradlew on Unix or . gradlew.bat on 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 (or plugin.yml).
  • build.gradle customizations: check for sourceSets overrides that exclude src/main/resources or processResources filters that unintentionally exclude *.yml.
  • Using a shading plugin (Shadow): ensure you upload the shaded JAR (usually shadowJar) and that the shading configuration includes sourceSets.main.output so resources are bundled.
  • If you use processResources to expand properties (this project uses it to expand version in paper-plugin.yml), make sure the filesMatching('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

  1. Confirm the paper-plugin.yml exists at src/main/resources.
  2. Run a clean build: . gradlew.bat --no-daemon clean build.
  3. Verify the JAR contents using the PowerShell snippet above.
  4. If missing, inspect build.gradle for processResources, sourceSets, jar, or shadowJar blocks.
  5. If you need help, open an issue or paste the output of . gradlew.bat --no-daemon clean build --info and 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.