Rudolf Ruin

analyze the ghost spear plugin on interlude smp and recreate it into a 1.21.11 paper server plug in. it works by using a ghost spear to lunge which sets you into a ghost state. more details in the video

Kodari AI
KodariSep 15 at 12:39 am 6
GhostSpearLunge
GhostSpearLunge is a Paper 1.21.11 plugin that recreates the Interlude SMP ghost spear mechanic. Players wielding a ghost spear item can activate a lunge ability that propels them forward while entering a temporary ghost state. During the ghost state, the player becomes semi-transparent, passes through blocks and entities, and is invulnerable to damage. The lunge is triggered by right-clicking with the spear, consuming durability or a cooldown resource. The plugin includes configurable cooldowns, ghost duration, lunge velocity, particle effects, and sound effects. It also handles edge cases like canceling the ghost state when the player attacks, takes fall damage after exiting, or disconnects. The spear item is customizable via configuration with custom model data, enchants, and lore.

Creating the core Ghost Spear Paper plugin: custom spear item, right-click lunge, temporary hidden/non-collidable ghost state, protection, and /ghostspear distribution command.

Created the Ghost Spear Paper plugin foundation.

  • /ghostspear [player] gives the custom Ghost Spear.

  • Right-click lunges the holder forward and enters a configurable ghost state.

  • Ghosts are hidden, non-collidable, protected from damage/fall damage, and cannot attack or interact with entities.

  • Ghost state fades automatically with portal effects and sounds.

  • Build configuration targets Java 21 and Paper 1.21.x.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 335
src/main/java/com/kodari/ghostspear/GhostSpearPlugin.java
package com.kodari.ghostspear;

import lombok.Getter;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class GhostSpearPlugin extends JavaPlugin {

    @Getter
    private GhostSpearManager ghostSpearManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        ghostSpearManager = new GhostSpearManager(this);
        getServer().getPluginManager().registerEvents(ghostSpearManager, this);

        PluginCommand command = getCommand("ghostspear");
        if (command != null) {
            command.setExecutor(ghostSpearManager);
        }
    }

    @Override
    public void onDisable() {
        if (ghostSpearManager != null) {
            ghostSpearManager.shutdown();
        }
    }
}