hude67ontop

FFA Request Plugin (Full FOLIA SUPPORT)

This plugin allows players to send a server-wide Free For All request with a built-in cooldown and smooth teleport flow with Folia Support.

When a player uses /ffa, an announcement is broadcast to all online players with full MiniMessage support, making it easy to fully customize the format, colors, and styling of every message. A sound is also played when the request is broadcast so it gets everyone’s attention immediately.

Players can join the active FFA by using /ffaaccept. Once accepted, they are not teleported instantly. Instead, they go through a 3-second teleport countdown, with action bar messages showing updates such as “Teleporting in 3...”, “Teleporting in 2...”, and “Teleporting in 1...” before being sent to the FFA location.

To prevent spam, /ffa has a 30-minute cooldown per player. Admins can bypass this cooldown with the appropriate permission.

Features

Server-wide FFA request system

/ffa to send an FFA request

/ffaaccept to join the active FFA

30-minute cooldown on FFA requests

Cooldown bypass permission for admins

3-second teleport delay after accepting

if player moves teleportation gets cancelled

Action bar countdown messages while teleporting

Broadcast sound effect when an FFA request is sent

Full MiniMessage support for all messages

Example Broadcast

FFA REQUEST <player> has sent an FFA request to everyone online.

Type /ffaaccept to accept.

Kodari AI
KodariMar 19 at 9:27 pm 12,256 (v2)

I’ll create a comprehensive FFA Request plugin with full Folia support and MiniMessage formatting. Let me start by reading the folialib documentation to ensure proper Folia scheduling implementation.

Now I’ll create the FFA Request plugin with full Folia support and MiniMessage formatting.

FFARequestPlugin
A Folia-compatible FFA request system that allows players to broadcast server-wide FFA invitations with a 30-minute cooldown. Features include smooth 3-second teleport countdown with movement cancellation, full MiniMessage support for rich text formatting, broadcast sound effects, and admin cooldown bypass permissions. All operations are thread-safe for Folia multi-region environments.

Perfect! I’ve created a comprehensive FFA Request plugin with full Folia support. Here’s what was implemented:

Core Features:

  • /ffa command to broadcast server-wide FFA requests with 30-minute cooldowns

  • /ffaaccept command to join active FFA with 3-second teleport countdown

  • Movement detection that cancels teleport if player moves during countdown

  • Full MiniMessage support for rich text formatting with gradients and clickable text

  • Broadcast sound effects using XSound for cross-version compatibility

  • Admin cooldown bypass permission (ffa.bypass.cooldown)

Folia-Safe Implementation:

  • All player operations use runAtEntity() for thread-safety

  • Teleportation uses teleportAsync() with CompletableFuture

  • All scheduling handled through FoliaLib wrapper

  • Proper task cancellation on plugin disable

Key Components:

  • FFAManager - Handles FFA requests, cooldowns, and broadcasts

  • TeleportManager - Manages 3-second countdown with movement detection and action bar messages

  • ConfigManager - MiniMessage parsing and configuration handling

  • Data classes with Lombok for clean code

The config includes beautiful MiniMessage examples with gradients, click actions, and emojis. All messages are fully customizable!

hude67ontop

FFA location is where the player is

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
12 623
src/main/java/com/example/ffarequest/FFARequestPlugin.java
package com.example.ffarequest;

import com.example.ffarequest.command.FFAAcceptCommand;
import com.example.ffarequest.command.FFACommand;
import com.example.ffarequest.manager.ConfigManager;
import com.example.ffarequest.manager.FFAManager;
import com.example.ffarequest.manager.TeleportManager;
import com.tcoded.folialib.FoliaLib;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class FFARequestPlugin extends JavaPlugin {

    private FoliaLib foliaLib;
    private ConfigManager configManager;
    private FFAManager ffaManager;
    private TeleportManager teleportManager;

    @Override
    public void onEnable() {
        foliaLib = new FoliaLib(this);
        
        saveDefaultConfig();
        
        configManager = new ConfigManager(this);
        ffaManager = new FFAManager(this);
        teleportManager = new TeleportManager(this);
        
        registerCommands();
        
        getLogger().info("FFARequestPlugin enabled with Folia support!");
    }

    @Override
    public void onDisable() {
        if (teleportManager != null) {
            teleportManager.cancelAllTeleports();
        }
        
        if (foliaLib != null) {
            foliaLib.getScheduler().cancelAllTasks();
        }
        
        getLogger().info("FFARequestPlugin disabled!");
    }

    private void registerCommands() {
        getCommand("ffa").setExecutor(new FFACommand(this));
        getCommand("ffaaccept").setExecutor(new FFAAcceptCommand(this));
    }
}