notxdgg

Create a Minecraft Paper plugin named xDFakePing for Paper 1.21.11.

Main Purpose

xDFakePing automatically replaces the ping displayed for players with a randomized fake ping based on their actual ping.

The plugin must work automatically. Players do not need to use any commands.

The plugin must not actually modify network latency. It should only modify the ping displayed through supported display systems such as the player list/TAB and PlaceholderAPI.

Automatic Fake Ping System

When a player joins:

  1. Detect their current real ping.
  2. Find the matching configured ping range.
  3. Generate a random fake ping inside that range.
  4. Display the fake ping instead of the real ping.
  5. Automatically regenerate the fake ping periodically.
  6. Continue doing this while the player is online.

Example default behavior:

  • Real ping "0–10ms" → fake "1–3ms"
  • Real ping "11–20ms" → fake "2–5ms"
  • Real ping "21–40ms" → fake "5–10ms"
  • Real ping "41–60ms" → fake "10–20ms"
  • Real ping "61–80ms" → fake "15–30ms"
  • Real ping "81–100ms" → fake "20–40ms"
  • Real ping "101–150ms" → fake "30–55ms"
  • Real ping "151–200ms" → fake "40–70ms"
  • Real ping "201ms+" → fake "50–80ms"

The ranges must be completely configurable in "config.yml".

Randomization

The fake ping should not remain constant.

For example, a player with a real ping of 120ms could display:

"37ms → 49ms → 42ms → 34ms → 51ms"

The generated value must always stay inside the configured range.

Add configurable:

update-interval: 5

where the value is in seconds.

TAB / Player List

The plugin should replace the ping shown in the Minecraft player list with the fake ping.

It should update the displayed ping automatically without requiring the player to reconnect.

Make the implementation compatible with modern Paper 1.21.11 APIs and avoid unnecessary packet manipulation where possible.

PlaceholderAPI

Add PlaceholderAPI support.

Placeholder:

%xdfakeping_ping%

It should return the player's current fake ping.

Optional:

%xdfakeping_real_ping%

should return the real ping only if explicitly enabled in the configuration.

Permissions

xdfakeping.bypass xdfakeping.admin

Players with:

xdfakeping.bypass

should see/use their real ping instead of the fake ping.

Commands

Add:

/xdfakeping reload /xdfakeping <player> <ping> /xdfakeping reset <player> /xdfakeping status

These commands are mainly for administrators.

"/xdfakeping reload"

  • Reload configuration.

"/xdfakeping <player> <ping>"

  • Manually set a fake ping for a player.

"/xdfakeping reset <player>"

  • Return the player to automatic fake-ping mode.

"/xdfakeping status"

  • Show whether xDFakePing is enabled and display statistics.

Configuration

Create a clean "config.yml" similar to:

enabled: true

update-interval: 5

placeholderapi: true

ranges: - real-min: 0 real-max: 10 fake-min: 1 fake-max: 3

- real-min: 11 real-max: 20 fake-min: 2 fake-max: 5

- real-min: 21 real-max: 40 fake-min: 5 fake-max: 10

- real-min: 41 real-max: 60 fake-min: 10 fake-max: 20

- real-min: 61 real-max: 80 fake-min: 15 fake-max: 30

- real-min: 81 real-max: 100 fake-min: 20 fake-max: 40

- real-min: 101 real-max: 150 fake-min: 30 fake-max: 55

- real-min: 151 real-max: 200 fake-min: 40 fake-max: 70

- real-min: 201 real-max: 9999 fake-min: 50 fake-max: 80

bypass: permission: "xdfakeping.bypass"

debug: false

Important Logic

The plugin must automatically recalculate the appropriate fake-ping range when the player's real ping changes significantly.

For example:

Real ping:

"35ms"

Fake ping:

"8ms"

Later:

"120ms"

The plugin should automatically move the player into the "101–150ms" range and generate something like:

"43ms".

However, small real-ping fluctuations should not cause unnecessary fake-ping changes.

Performance

The plugin must be lightweight.

Do not create an individual repeating task for every player.

Use a centralized scheduler/task that processes online players efficiently.

Avoid excessive packet sending.

Clean up player data when players disconnect.

Do not introduce memory leaks.

Messages

Create configurable messages:

messages: prefix: "&8[&b&lxDFakePing&8] "

no-permission: "&cYou don't have permission." player-not-found: "&cPlayer not found." reloaded: "&aConfiguration reloaded successfully." manual-set: "&aFake ping for &f%player% &aset to &f%ping%ms&a." reset: "&a%player% is now using automatic fake ping." status: "&7xDFakePing: &aEnabled"

Technical Requirements

  • Java
  • Paper API 1.21.11
  • Maven or Gradle
  • Clean OOP architecture
  • No unnecessary dependencies
  • Optional PlaceholderAPI integration
  • Proper plugin.yml
  • Config validation
  • Error handling for invalid ranges
  • Thread-safe player data where appropriate
  • JavaDoc for important classes/methods
  • No hardcoded messages
  • No hardcoded ping ranges
  • No database required

Project Structure

Use a clean structure such as:

src/main/java/ └── me/xd/xdfakeping/ ├── XDFakePing.java ├── command/ │ └── FakePingCommand.java ├── listener/ │ └── PlayerListener.java ├── manager/ │ └── FakePingManager.java ├── model/ │ └── PingRange.java ├── placeholder/ │ └── FakePingPlaceholder.java └── util/ └── PingUtil.java

The final plugin should compile successfully and work on Paper 1.21.11.

Most importantly, fake ping must be automatic by default. A normal player joins the server and immediately gets a randomized displayed ping without having to configure or execute anything.

Kodari AI
KodariAug 18 at 3:32 pm 3
XDFakePing
A Paper 1.21.11 plugin that automatically replaces displayed player ping with randomized fake values based on configurable real-ping ranges. Features centralized scheduler for efficient periodic updates, TAB/player-list integration, optional PlaceholderAPI support with %xdfakeping_ping% and %xdfakeping_real_ping% placeholders, admin commands for manual ping setting/reset/reload/status, bypass permission for real ping display, fully configurable ranges and messages in config.yml, automatic range recalculation when real ping changes significantly, and clean OOP architecture with proper cleanup on disconnect.
  1. Create the Paper 1.21.11 Gradle project and plugin metadata.

  2. Implement configurable range parsing, centralized fake-ping state, automatic updates, and TAB ping rewriting.

  3. Add commands, permissions, configurable messages, and optional PlaceholderAPI placeholders.

  1. Created the Paper 1.21.11 Gradle project for xDFakePing.

  2. Added configurable ping ranges, randomized regeneration, range recalculation, bypass handling, manual overrides, reset support, and centralized scheduling.

  3. Added Paper player-list latency rewriting through PlayerInfoUpdateEvent.

  4. Added PlaceholderAPI support:

    • %xdfakeping_ping%

    • Optional %xdfakeping_real_ping%

  5. Added /xdfakeping reload, /xdfakeping <player> <ping>, /xdfakeping reset <player>, and /xdfakeping status.

  6. Added permissions, configurable messages, validation warnings, plugin metadata, and cleanup on disconnect.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
11 695
src/main/java/me/xd/xdfakeping/XDFakePing.java
package me.xd.xdfakeping;

import me.xd.xdfakeping.command.FakePingCommand;
import me.xd.xdfakeping.listener.PlayerListener;
import me.xd.xdfakeping.manager.FakePingManager;
import me.xd.xdfakeping.placeholder.FakePingPlaceholder;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Map;

/** Main plugin entry point for automatic randomized displayed ping values. */
public final class XDFakePing extends JavaPlugin {
    private FakePingManager fakePingManager;
    private FakePingPlaceholder placeholder;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        fakePingManager = new FakePingManager(this);
        fakePingManager.reload();

        Bukkit.getPluginManager().registerEvents(new PlayerListener(fakePingManager), this);
        PluginCommand command = getCommand("xdfakeping");
        if (command != null) {
            FakePingCommand executor = new FakePingCommand(this, fakePingManager);
            command.setExecutor(executor);
            command.setTabCompleter(executor);
        }
        updatePlaceholderRegistration();
    }

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

    /** Reloads all plugin configuration and applies the new scheduler settings. */
    public void reloadPluginConfiguration() {
        reloadConfig();
        fakePingManager.reload();
        updatePlaceholderRegistration();
    }

    public FakePingManager getFakePingManager() {
        return fakePingManager;
    }

    /** Sends a configured, colorized message with percent-style replacements. */
    public void sendMessage(CommandSender sender, String key, Map<String, String> replacements) {
        String message = getConfig().getString("messages." + key, "");
        String prefix = getConfig().getString("messages.prefix", "");
        String result = prefix + message;
        for (Map.Entry<String, String> replacement : replacements.entrySet()) {
            result = result.replace("%" + replacement.getKey() + "%", replacement.getValue());
        }
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', result));
    }

    private void updatePlaceholderRegistration() {
        if (placeholder != null) {
            placeholder.unregister();
            placeholder = null;
        }
        if (getConfig().getBoolean("placeholderapi", true)
                && Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
            placeholder = new FakePingPlaceholder(this);
            placeholder.register();
        }
    }
}