ilikeracing8-ops

make a tpa dialog copy off this image

1 image attached
Kodari AI
KodariAug 7 at 5:40 pm 3
TPADialog
A Minecraft plugin that adds a teleport request (TPA) system with a graphical dialog interface. When a player requests to teleport to another player, the recipient receives an interactive GUI dialog showing the requester's name, head, and buttons to accept or deny the request. Includes configurable cooldowns, timeout durations, and permission-based access. The dialog uses a chest inventory interface with clear visual indicators for accepting or rejecting teleport requests, along with optional sound effects and message notifications for both parties.

I’ll create a configurable Bukkit/Paper TPA plugin with /tpa and /tpahere, clickable chat actions, an inventory confirmation dialog matching the supplied layout, request expiry/cooldowns, and /tpaccept, /tpdeny, and /tpcancel.

Created a complete configurable TPA dialog plugin from scratch.

Features include:

  • /tpa <player>

  • /tpahere <player>

  • /tpaccept [player]

  • /tpdeny [player]

  • /tpcancel

  • Inventory confirmation menu styled after the supplied image

  • Accept/deny buttons

  • Clickable chat accept/deny actions

  • Request expiration

  • Request cooldowns

  • Teleport delay

  • Configurable messages, materials, GUI slots, titles, lore, and directions

  • TPA request cleanup when players leave

  • XSeries material compatibility

  • Gradle build configuration and plugin metadata

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
13 726
src/main/java/com/kodari/tpa/TpaPlugin.java
package com.kodari.tpa;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.TabCompleter;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public class TpaPlugin extends JavaPlugin {
    private TpaManager tpaManager;
    private TpaGui tpaGui;

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

        tpaGui = new TpaGui(this);
        tpaManager = new TpaManager(this);

        TpaCommand command = new TpaCommand(this);
        registerCommand("tpa", command);
        registerCommand("tpahere", command);
        registerCommand("tpaccept", command);
        registerCommand("tpdeny", command);
        registerCommand("tpcancel", command);

        getServer().getPluginManager().registerEvents(new TpaListener(this), this);
    }

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

    private void registerCommand(String name, CommandExecutor executor) {
        PluginCommand command = getCommand(name);
        if (command != null) {
            command.setExecutor(executor);
            if (executor instanceof TabCompleter) {
                command.setTabCompleter((TabCompleter) executor);
            }
        }
    }

    public TpaManager getTpaManager() {
        return tpaManager;
    }

    public TpaGui getTpaGui() {
        return tpaGui;
    }

    public String message(String key, String... replacements) {
        String value = getConfig().getString("messages." + key, key);
        String prefix = getConfig().getString("messages.prefix", "");
        value = value.replace("%prefix%", prefix);
        for (int i = 0; i + 1 < replacements.length; i += 2) {
            value = value.replace(replacements[i], replacements[i + 1]);
        }
        return color(value);
    }

    public String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text == null ? "" : text);
    }
}