bafi_tv88

Create a Minecraft plugin (Spigot/Paper, Java 1.20+) called "GhostMode".

CORE:

  • When a player dies, they become a ghost for 20 seconds.

GHOST FEATURES:

  • Player becomes invisible to others (except permission).
  • Can fly ONLY within 20x20 blocks from death location.
  • Cannot go outside this radius (teleport back if exceeded).
  • Cannot interact with blocks (no breaking/placing).
  • Can send whisper messages visible only to players within 10 blocks.

END:

  • After 20 seconds:

- Player respawns normally (bed/spawn) - Ghost mode ends automatically

EXTRA:

  • Optional particles and spooky sounds

PERMISSIONS:

  • ghost.see → allows players to see ghosts

CONFIG:

  • ghost_duration: 20
  • radius: 20
  • whisper_radius: 10
  • effects: true/false

TECH:

  • Optimized
  • No lag
  • Modern API only
Kodari AI
KodariApr 2 at 6:18 pm 11,279 (v2)

I’ll create a comprehensive ghost mode plugin with optimized mechanics and modern API usage.

GhostMode
Transform deceased players into ghosts for 20 seconds with restricted movement within a 20-block radius of their death location. Ghosts can fly within bounds, send proximity-based whisper messages, and are invisible to players without permission. Features automatic respawn, particle effects, spooky ambience, and configurable settings for duration, radius, and visual effects.

All files created! The GhostMode plugin is complete with:

Core Features:

  • Ghost activation on death for 20 seconds

  • Flight restricted to 20-block radius from death point

  • Boundary enforcement with teleport-back

  • Whisper chat visible only within 10 blocks

  • Invisibility to players without ghost.see permission

  • Particle effects (cloud) and spooky sounds

  • Automatic respawn to bed/spawn after duration

Technical Highlights:

  • Optimized movement checking (block-level comparison)

  • Clean visibility system using hidePlayer/showPlayer API

  • Async-safe chat handling

  • Memory-efficient ghost tracking

  • Configurable duration, radius, and effects

  • /ghost reload command for config updates

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 495
src/main/java/com/ghostmode/GhostMode.java
package com.ghostmode;

import com.ghostmode.command.GhostCommand;
import com.ghostmode.listener.PlayerListener;
import com.ghostmode.manager.ConfigManager;
import com.ghostmode.manager.GhostManager;
import com.ghostmode.task.GhostTask;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class GhostMode extends JavaPlugin {
    private ConfigManager configManager;
    private GhostManager ghostManager;
    private GhostTask ghostTask;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.ghostManager = new GhostManager();

        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);

        this.getCommand("ghost").setExecutor(new GhostCommand(this));

        this.ghostTask = new GhostTask(this);
        this.ghostTask.runTaskTimer(this, 20L, 20L);

        this.getLogger().info("GhostMode has been enabled!");
    }

    @Override
    public void onDisable() {
        if (this.ghostTask != null) {
            this.ghostTask.cancel();
        }
        this.getLogger().info("GhostMode has been disabled!");
    }
}