dexterxdd
📎 1 file 8,322 chars
📄
pasted-code-1786155337832.txt
txt 365 lines
▶
Create a complete, buildable Minecraft Paper plugin called "FakePing".

TARGET:
- Minecraft: 1.21.11
- Server: Paper 1.21.11
- Java: Use the Java version required by Paper 1.21.11
- ProtocolLib: Already installed on my server

I also have an existing FakePlayers plugin JAR. I will provide that JAR to you.

==================================================
WHAT THIS PLUGIN DOES
==================================================

My existing FakePlayers plugin creates fake players that appear in the Minecraft TAB list.

IMPORTANT:
These fake players are NOT real Bukkit Player entities.

Their TAB ping currently appears as 0 ms.

FakePing must change ONLY the displayed TAB ping of specific fake players.

Example:

config.yml:

players:
  - Mlxzs
  - Uqouh
  - ItzCube6
  - johnny_the_beast
  - pizzaveil

ping:
  min: 35
  max: 85

The result should be something like:

Mlxzs             47 ms
Uqouh             72 ms
ItzCube6          51 ms

Real players must remain completely untouched.

==================================================
IMPORTANT: ANALYZE THE PROVIDED JAR
==================================================

Before writing the plugin:

Analyze the provided FakePlayers JAR.

Determine:

1. How it creates fake TAB-list players.
2. How it sends their TAB/player-info data.
3. Which packet/action is responsible for their displayed ping.
4. Whether the fake-player UUID/name is stored anywhere useful.
5. How fake players are added and recreated.

The provided FakePlayers plugin is the source of truth.

Do NOT assume these fake players are Bukkit Player objects.

Do NOT use Player#getPing().

Do NOT create entities.

Do NOT create NPCs.

==================================================
PROTOCOLLIB
==================================================

Use ProtocolLib for packet interception/modification.

ProtocolLib is already installed on my server.

Do NOT shade ProtocolLib into the plugin.

Declare ProtocolLib as a provided dependency.

Intercept the appropriate outgoing TAB/player-info packet.

For configured fake-player names:

- Change only their displayed ping.
- Leave the rest of the packet unchanged.
- Do not modify real players.
- Do not cancel packets unnecessarily.

Use the correct ProtocolLib API for Minecraft/Paper 1.21.11.

Do not use outdated packet examples from older Minecraft versions.

==================================================
CONFIGURATION
==================================================

Create:

config.yml

with:

players:
  - Mlxzs
  - Uqouh
  - ItzCube6
  - johnny_the_beast
  - pizzaveil

ping:
  min: 35
  max: 85

Username matching must be case-insensitive.

If:

players:
  - Mlxzs

then these should all match:

Mlxzs
mlxzs
MLXZS

==================================================
PING BEHAVIOR
==================================================

Generate a random integer between min and max, inclusive.

For example:

min: 35
max: 85

Valid values:

35-85

Each configured fake player should receive its own random ping.

The ping does NOT need to constantly fluctuate.

A new random value may be generated when the fake player is created/recreated.

==================================================
AUTOMATIC OPERATION
==================================================

The plugin must work automatically after every server restart.

No command should be required.

It must also work if FakePlayers loads or creates its fake players after FakePing.

The packet listener should automatically catch fake-player TAB packets whenever they are sent.

If FakePlayers removes and recreates a fake player, FakePing must work again automatically.

Do NOT depend on a one-time startup scan.

==================================================
REAL PLAYER PROTECTION
==================================================

This is extremely important.

FakePing must NOT spoof real players.

Only the fake-player TAB entries created by the FakePlayers plugin should be affected.

Analyze the provided FakePlayers JAR to determine how its fake TAB entries can be distinguished from real players.

Do not simply match a username and alter a real player's packet if that same username exists as a real player.

Use the safest reliable identification method available.

==================================================
ERROR HANDLING
==================================================

The plugin must safely handle:

- FakePlayers not installed.
- Empty players list.
- Configured fake player not existing.
- Fake player being removed.
- Fake player being recreated.
- Invalid min/max values.
- Missing config values.
- Unexpected packet contents.

The plugin must never crash the server because of FakePing.

If min > max, handle it safely and print a clear warning.

==================================================
KEEP IT SIMPLE
==================================================

Do NOT add:

- PlaceholderAPI
- Database
- INVENTORY GUI
- Web panel
- Economy
- BStats
- Update checker
- Complex commands
- Permissions
- Fake entities
- NPCs
- Real-player ping spoofing
- Ping animations
- Unnecessary libraries

This should be a small extension plugin.

==================================================
PLUGIN DETAILS
==================================================

Plugin name:

FakePing

Main class:

me.example.fakeping.FakePingPlugin

No commands are required.

No permissions are required.

plugin.yml must correctly declare:

- name
- version
- main
- api-version
- ProtocolLib dependency

Use the correct Paper API for Paper 1.21.11.

==================================================
MAVEN PROJECT
==================================================

Create a complete Maven project.

Required files:

pom.xml

src/main/resources/plugin.yml

src/main/resources/config.yml

src/main/java/me/example/fakeping/...

ProtocolLib must be a provided dependency.

Do not bundle/shade ProtocolLib.

Keep the final JAR small.

==================================================
STARTUP
==================================================

Print a simple startup message such as:

[FakePing] Enabled.
[FakePing] Loaded X configured fake players.
[FakePing] Ping range: 35-85 ms

Do not spam the console every time a packet is processed.

==================================================
CODE QUALITY
==================================================

Keep the number of classes low.

Use clean, readable Java.

Avoid unnecessary abstractions.

Use null checks.

Avoid reflection unless absolutely necessary.

Use the current ProtocolLib API compatible with the selected version.

Do not invent APIs.

==================================================
BUILD VALIDATION
==================================================

Before giving me the final answer:

Check:

- Java imports
- Maven dependencies
- Paper API version
- ProtocolLib version
- plugin.yml
- config.yml
- packet types
- ProtocolLib packet structures
- Minecraft 1.21.11 compatibility

If you have access to a build environment, ACTUALLY RUN:

mvn clean package

Fix all compilation errors before giving me the final project.

Do NOT claim that it compiles unless you actually verified it.

==================================================
FINAL OUTPUT
==================================================

Give me the complete project.

Show the exact folder structure.

Provide the complete contents of every required file.

Then provide:

1. Exact build command.
2. Exact location of the generated JAR.
3. Installation instructions.
4. Testing instructions.
5. Any compatibility limitation discovered from analyzing FakePlayers.jar.

I need a complete buildable plugin, not pseudocode or partial code.

The final goal is:

FakePlayers creates fake TAB players
        ↓
FakePing detects their TAB/player-info packet
        ↓
Checks username against config
        ↓
Assigns random ping between min/max
        ↓
Minecraft TAB displays that fake ping

Real players:
        ↓
Completely unaffected.
Kodari AI
KodariAug 8 at 2:17 am 2
FakePing
FakePing is a lightweight Paper plugin that modifies the displayed TAB-list ping of fake players created by the FakePlayers plugin. It intercepts outgoing player-info packets via ProtocolLib, matches configured usernames case-insensitively, and assigns each fake player a random ping value within a configurable range. Real players remain completely unaffected. The plugin operates automatically without commands, handles fake player recreation, and includes robust error handling for missing or invalid configurations.
  1. Create the Maven project and Paper/ProtocolLib dependency declarations.

  2. Implement packet-only fake-player ping rewriting with case-insensitive configuration and real-player protection.

  3. Add plugin metadata and safe default configuration.

The implementation is in place. I’m correcting the packet-entry replacement to use ProtocolLib’s documented 1.21.4+ constructor so every existing TAB field is preserved while only latency changes.Implemented the complete Maven project for FakePing.

Project structure

Plain Text
fakeping/
├── pom.xml
└── src/
    └── main/
        ├── java/
        │   └── me/
        │       └── example/
        │           └── fakeping/
        │               └── FakePingPlugin.java
        └── resources/
            ├── config.yml
            └── plugin.yml

Features implemented

  • Paper API 1.21.11

  • Java release target 21

  • ProtocolLib as a provided dependency

  • Intercepts PLAYER_INFO_UPDATE packets

  • Changes only latency values

  • Case-insensitive configured-name matching

  • Random ping generated inclusively between configured minimum and maximum

  • Stable ping assignment until plugin restart

  • Real online players protected by UUID tracking

  • Handles players joining, leaving, removal, and recreation

  • No commands, entities, NPCs, databases, or GUI

  • Safe handling for invalid configuration values

  • No packet-processing console spam

  • ProtocolLib packet listeners removed during shutdown

Build command

Shell
mvn clean package

Generated JAR

Plain Text
target/fakeping-1.0.0.jar

Installation

  1. Build the project.

  2. Copy target/fakeping-1.0.0.jar into the server’s plugins directory.

  3. Ensure ProtocolLib is also installed.

  4. Ensure the existing FakePlayers plugin is installed.

  5. Start or restart the server.

  6. Edit:

Plain Text
plugins/FakePing/config.yml
  1. Restart the server after configuration changes.

Testing

Configure a fake player:

YAML
players:
  - Mlxzs

ping:
  min: 35
  max: 85

Then verify:

  • Mlxzs, mlxzs, and MLXZS all match.

  • The fake player displays a ping from 35 through 85.

  • Real players are not modified.

  • Removing and recreating the fake player causes it to receive a ping again.

  • FakePing starts safely when the configured fake player does not exist.

Compatibility limitation

The supplied attachment contains the project specification as text, but no actual FakePlayers JAR was available to inspect. Therefore, the implementation uses the standard modern ProtocolLib PLAYER_INFO_UPDATE packet and identifies entries using their profile name while protecting currently online real players by UUID.

A real FakePlayers JAR would be required to verify whether that plugin exposes a stronger fake-player identifier or uses a special UUID convention.

dexterxdd

should i send u fake player jar

Kodari AI
KodariAug 8 at 2:18 am 1

Yes. Please upload the FakePlayers JAR.

It’s important because I need to inspect how it:

  • Generates fake-player UUIDs and profiles

  • Sends PLAYER_INFO_UPDATE / TAB packets

  • Adds and recreates fake players

  • Distinguishes fake entries from real players

Without the JAR, matching by username cannot guarantee that real players with the same name remain untouched.

If possible, also send:

  • FakePlayers plugin version

  • Server/Paper version

  • Any startup errors or packet-related behavior you’ve observed

After you upload it, I can analyze the JAR and adjust FakePing to use the safest reliable identification method.

dexterxdd

it does not support that typr of file

Kodari AI
KodariAug 8 at 2:19 am 1

Rename or archive it before uploading:

Option 1: Put the JAR inside a ZIP

Create fakeplayers-analysis.zip containing:

Plain Text
FakePlayers.jar

Then upload the ZIP file.

Option 2: Rename the JAR

A JAR is technically a ZIP archive, so rename:

Plain Text
FakePlayers.jar → FakePlayers.zip

Upload that file. I can inspect its contents and determine how fake TAB entries are created.

If ZIP uploads are also blocked, extract the JAR and upload these files instead:

Plain Text
plugin.yml
META-INF/
the plugin's .class files

A decompiled source ZIP is also fine. Do not include server data, player databases, configuration secrets, or license keys.

dexterxdd

ill archive it into zip

Kodari AI
KodariAug 8 at 2:20 am 1

Upload the ZIP containing the FakePlayers JAR when ready. I’ll inspect its classes, metadata, UUID handling, and TAB packet implementation before adjusting FakePing.

Kodari can make mistakes. Review important code before using.
Files
src
IMPORTANT.txt
pom.xml
Code
5 253
src/main/java/me/example/fakeping/FakePingPlugin.java
package me.example.fakeping;

import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.ListenerPriority;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.wrappers.PlayerInfoData;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicBoolean;

public final class FakePingPlugin extends JavaPlugin implements Listener {
    private final Set<String> configuredPlayers = ConcurrentHashMap.newKeySet();
    private final Set<UUID> onlinePlayerIds = ConcurrentHashMap.newKeySet();
    private final ConcurrentHashMap<String, Integer> assignedPings = new ConcurrentHashMap<>();
    private final AtomicBoolean malformedPacketWarningSent = new AtomicBoolean();

    private int minimumPing;
    private int maximumPing;

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

        if (Bukkit.getPluginManager().getPlugin("ProtocolLib") == null) {
            getLogger().severe("ProtocolLib is not installed; disabling FakePing.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        for (Player player : Bukkit.getOnlinePlayers()) {
            onlinePlayerIds.add(player.getUniqueId());
        }
        Bukkit.getPluginManager().registerEvents(this, this);
        ProtocolLibrary.getProtocolManager().addPacketListener(
                new TabPacketListener(this));

        getLogger().info("Enabled.");
        getLogger().info("Loaded " + configuredPlayers.size() + " configured fake players.");
        getLogger().info("Ping range: " + minimumPing + "-" + maximumPing + " ms");
    }

    @Override
    public void onDisable() {
        if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
            ProtocolLibrary.getProtocolManager().removePacketListeners(this);
        }
    }

    private void loadSettings() {
        Set<String> names = new HashSet<>();
        for (String name : getConfig().getStringList("players")) {
            if (name != null && !name.trim().isEmpty()) {
                names.add(name.trim().toLowerCase(Locale.ROOT));
            }
        }
        configuredPlayers.addAll(Collections.unmodifiableSet(names));

        int min = getConfig().getInt("ping.min", 35);
        int max = getConfig().getInt("ping.max", 85);
        if (min < 0) {
            getLogger().warning("ping.min cannot be negative; using 0.");
            min = 0;
        }
        if (max < 0) {
            getLogger().warning("ping.max cannot be negative; using 0.");
            max = 0;
        }
        if (min > max) {
            getLogger().warning("ping.min is greater than ping.max; swapping the values.");
            int temporary = min;
            min = max;
            max = temporary;
        }
        minimumPing = min;
        maximumPing = max;
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        onlinePlayerIds.add(event.getPlayer().getUniqueId());
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        onlinePlayerIds.remove(event.getPlayer().getUniqueId());
    }

    private boolean isOnlinePlayer(UUID profileId) {
        return profileId != null && onlinePlayerIds.contains(profileId);
    }

    private Integer getPing(String profileName) {
        if (profileName == null) {
            return null;
        }
        String normalizedName = profileName.trim().toLowerCase(Locale.ROOT);
        if (!configuredPlayers.contains(normalizedName)) {
            return null;
        }
        return assignedPings.computeIfAbsent(normalizedName, ignored ->
                (int) ThreadLocalRandom.current().nextLong(minimumPing, (long) maximumPing + 1L));
    }

    private void warnMalformedPacket() {
        if (malformedPacketWarningSent.compareAndSet(false, true)) {
            getLogger().warning("Received an unexpected PLAYER_INFO_UPDATE packet; it was ignored.");
        }
    }

    private final class TabPacketListener extends PacketAdapter {
        private TabPacketListener(JavaPlugin plugin) {
            super(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO);
        }

        @Override
        public void onPacketSending(PacketEvent event) {
            try {
                List<PlayerInfoData> originalEntries = event.getPacket()
                        .getPlayerInfoDataLists().read(0);
                if (originalEntries == null || originalEntries.isEmpty()) {
                    return;
                }

                List<PlayerInfoData> updatedEntries = new ArrayList<>(originalEntries);
                boolean changed = false;
                for (int index = 0; index < updatedEntries.size(); index++) {
                    PlayerInfoData entry = updatedEntries.get(index);
                    if (entry == null || isOnlinePlayer(entry.getProfileId())) {
                        continue;
                    }

                    String profileName = entry.getProfile() == null
                            ? null : entry.getProfile().getName();
                    Integer ping = getPing(profileName);
                    if (ping != null) {
                        updatedEntries.set(index, new PlayerInfoData(
                                entry.getProfileId(),
                                ping,
                                entry.isListed(),
                                entry.getGameMode(),
                                entry.getProfile(),
                                entry.getDisplayName(),
                                entry.isShowHat(),
                                entry.getListOrder(),
                                entry.getRemoteChatSessionData()));
                        changed = true;
                    }
                }

                if (changed) {
                    event.getPacket().getPlayerInfoDataLists().write(0, updatedEntries);
                }
            } catch (RuntimeException exception) {
                warnMalformedPacket();
            }
        }
    }
}