Tariquzzaman
📎 1 file 2,431 chars
📄
pasted-code-1794334378046.txt
txt 54 lines
▶
Update and expand the Paper plugin named Stealth targeted for Minecraft 1.21+ (including all future 1.21.x and 1.22+ versions).

Detailed Requirements & Fixes:
Persistent Invisibility on Rejoin:

If a player disconnects/leaves the server while under the Invisibility potion effect and rejoins, the plugin must immediately re-apply the stealth status (obfuscated tablist name, obfuscated join message, and mugm_ skin via SkinsRestorer API) instantly upon joining.

Delayed Broadcast for Join / Left Messages:

When a player joins or quits while invisible, suppress/cancel the default vanilla join/left message (PlayerJoinEvent#setJoinMessage(null) and PlayerQuitEvent#setQuitMessage(null)).

Use a short asynchronous/synchronous scheduler delay (e.g., 2 to 5 ticks / ~100–250ms) using Bukkit's scheduler (Bukkit.getScheduler().runTaskLater(...)).

Once the delay passes, check if the player's invisibility/stealth state is active, build the component with the obfuscated name (Name), and manually broadcast the custom join/quit message to the server. This prevents race conditions where the message fires before the plugin or SkinsRestorer registers the state.

Tablist Anonymization:

When a player has the Invisibility effect (or rejoins with it), their tablist display name must be obfuscated using MiniMessage format (Username or §k).

Restore their normal tablist name when the effect wears off or is removed.

Advancements Anonymization:

Intercept advancement completion broadcasts (PlayerAdvancementDoneEvent) and obfuscate the player's name if they are invisible.

Skin Disguise Integration (SkinRestorer API):

Hook into the SkinsRestorer API.

When Invisibility is applied / player joins with invisibility: Temporarily set the player's skin profile to mugm_.

When Invisibility expires or is removed: Restore their original skin, or reset/clear their custom skin back to default if they had no custom skin.

Technical Specifications:
Server Core: Paper API (1.21+ using net.kyori.adventure components).

Soft Depend: SkinsRestorer.

Events to Listen:

EntityPotionEffectEvent

PlayerJoinEvent

PlayerQuitEvent

PlayerAdvancementDoneEvent

Deliverables:
Updated pom.xml / build.gradle.kts.

plugin.yml (api-version: '1.21').

Fully realized Java classes handling the delayed broadcast logic, rejoin checks, tablist modification, advancement hiding, and SkinsRestorer hook.
Kodari AI
KodariNov 10 at 6:21 pm 30
StealthInvisibility
A Paper plugin for Minecraft 1.21+ that provides persistent invisibility management. When players have the Invisibility effect, it obfuscates their tablist name, join/quit messages, and advancement broadcasts using MiniMessage formatting. The plugin re-applies stealth status instantly on rejoin, suppresses default join/quit messages, and broadcasts delayed custom messages to prevent race conditions. It integrates with SkinsRestorer API to temporarily set the mugm_ skin while invisible and restore the original skin when the effect expires. The plugin listens to EntityPotionEffectEvent, PlayerJoinEvent, PlayerQuitEvent, and PlayerAdvancementDoneEvent to manage all stealth features seamlessly.
  • Track invisibility across effect changes, joins and quits.

  • Anonymize tab names, join/quit messages and advancements.

  • Apply and restore SkinsRestorer disguises when available.

Built Stealth for Paper 1.21+ with tab and advancement anonymization, delayed join/quit messages, and optional SkinsRestorer integration.

Join and quit messages are delayed three ticks for all players. The mugm_ skin is preloaded asynchronously, so its first application depends on the lookup completing.

Obfuscation is visual: clients can still inspect the underlying username. Future-version compatibility depends on Paper and SkinsRestorer maintaining compatible APIs.

Tariquzzaman

The compilation failed with this error:

code
Compilation failed with 9 error(s):

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 4: package net.skinsrestorer.api does not exist
import net.skinsrestorer.api.SkinsRestorer;
                            ^

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 5: package net.skinsrestorer.api does not exist
import net.skinsrestorer.api.SkinsRestorerProvider;
                            ^

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 6: package net.skinsrestorer.api.property does not exist
import net.skinsrestorer.api.property.MojangSkinDataResult;
                                     ^

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 7: package net.skinsrestorer.api.property does not exist
import net.skinsrestorer.api.property.SkinApplier;
                                     ^

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 8: package net.skinsrestorer.api.property does not exist
import net.skinsrestorer.api.property.SkinProperty;
                                     ^

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 23: cannot find symbol
    private final SkinsRestorer skinsRestorer;
                  ^
  symbol: class SkinsRestorer
  location: class SkinsRestorerHook

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 24: cannot find symbol
    private final SkinApplier<Player> skinApplier;
                  ^
  symbol: class SkinApplier
  location: class SkinsRestorerHook

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 29: cannot find symbol
    private SkinProperty disguiseSkin;
            ^
  symbol: class SkinProperty
  location: class SkinsRestorerHook

ERROR in src/main/java/com/kodari/stealth/SkinsRestorerHook.java at line 142: cannot find symbol
    private void finishLookup(SkinProperty result, String failure) {
                              ^
  symbol: class SkinProperty
  location: class SkinsRestorerHook


=== COMPILATION ERROR ANALYSIS ===

MISSING CLASSES:
  - SkinsRestorer
  - SkinApplier
  - SkinProperty
ACTION: Create these classes or check imports

FILES TO INVESTIGATE:
  - src/main/java/com/kodari/stealth/SkinsRestorerHook.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariNov 10 at 6:24 pm 8

The dependency is already declared in Gradle, but the compiler can’t resolve it. I’ll use SkinsRestorer’s API at runtime so the optional hook still works without compile-time imports.

Fixed the missing SkinsRestorer classes by loading its optional API at runtime instead of requiring it at compile time. The skin disguise integration remains in place.

Tariquzzaman

add obfuscated text on kill and death while having invisibility . if the player have any weapon name it should show like default but the player name should have obfuscated

Kodari AI
KodariNov 10 at 6:33 pm 1

[Generation stopped]

Tariquzzaman

add obfuscated text on kill and death while having invisibility . if the player have any weapon name it should show like default but the player name should have obfuscated. and also if the player is chatting the obfuscated text should appear on his/her name

Kodari AI
KodariNov 10 at 6:37 pm 8
  1. Obfuscate invisible players’ names in death messages while preserving weapon names.

  2. Obfuscate invisible players’ names in chat.

Added obfuscated names for invisible players in default death messages and chat. Weapon names and chat text remain unchanged.

Custom death-message formats or chat renderers that ignore the supplied display name may bypass masking.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle.kts
settings.gradle.kts
Code
8 567
src/main/java/com/kodari/stealth/StealthPlugin.java
package com.kodari.stealth;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class StealthPlugin extends JavaPlugin {
    private StealthManager stealthManager;

    @Override
    public void onEnable() {
        SkinDisguise skinDisguise = null;
        if (getServer().getPluginManager().isPluginEnabled("SkinsRestorer")) {
            try {
                skinDisguise = new SkinsRestorerHook(this);
            } catch (RuntimeException | LinkageError exception) {
                getLogger().warning("SkinsRestorer integration is unavailable: " + exception.getMessage());
            }
        } else {
            getLogger().info("SkinsRestorer is not installed; skin disguises are disabled.");
        }

        stealthManager = new StealthManager(skinDisguise);
        getServer().getPluginManager().registerEvents(new StealthListener(this, stealthManager), this);
        Bukkit.getOnlinePlayers().forEach(stealthManager::sync);
        Bukkit.getScheduler().runTaskTimer(this,
                () -> Bukkit.getOnlinePlayers().forEach(stealthManager::sync), 5L, 5L);
    }

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