D

WorldGuardTitles is a lightweight WorldGuard region notification plugin with Folia support and async schedulers for smooth, lag-free performance.

Configure custom messages and effects for each WorldGuard region directly in config.yml. When a player enters a configured region, the plugin can display a title, subtitle, actionbar message, chat message, run commands, and play one or multiple sounds. If the player leaves and re-enters the region, the configured effects are triggered again.

Features:

Works with WorldGuard regions Folia supported Async handling for no lag Fully configurable per region Title, subtitle, actionbar, and chat support Command execution support Multiple sounds per region MiniMessage support PlaceholderAPI support, including %player% Simple reload command: /worldguardtitles reload

Config Example:

regions: spawn_1: title: "<green>Welcome To Spawn 1" subtitle: "<gray>Welcome <yellow>%player%" actionbar: "<aqua>You are now in the spawn zone" chat: "<green>Du bist im Spawn" command: "" sounds: - BLOCK_ANVIL_LAND - ENTITY_PLAYER_LEVELUP

afk: title: "<yellow>Welcome To AFK" subtitle: "<gray>Welcome <yellow>%player%" actionbar: "<aqua>You are now in the AFK zone" chat: "<yellow>Du bist im AFK" command: "" sounds: - BLOCK_ANVIL_LAND

Leaving any value empty, for example title: "", means that nothing will be shown or executed for that option.

Kodari AI
KodariMay 2 at 4:20 pm 10,082 (v2)

I’ll create a WorldGuard region notification plugin with Folia support and async handling.

WorldGuardTitles
A lightweight WorldGuard region notification plugin with Folia support. Displays custom titles, subtitles, actionbar messages, chat messages, plays sounds, and executes commands when players enter configured regions. Features include MiniMessage formatting, PlaceholderAPI integration, async region tracking for optimal performance, and per-region configuration. Supports multiple sounds per region and fully customizable effects. Easy management with a simple reload command.

Project created successfully!

The plugin is now ready with all core features:

✅ WorldGuard Integration - Detects region entry using async region tracking
✅ Folia Support - Uses FoliaLib for cross-platform compatibility
✅ Per-Region Configuration - Customizable titles, subtitles, actionbar, chat, commands, sounds
✅ MiniMessage Support - Full gradient, hex, and formatting support via ColorUtil
✅ PlaceholderAPI Support - Including built-in %player% placeholder
✅ Multiple Sounds - XSound integration for cross-version compatibility
✅ Reload Command - /worldguardtitles reload with tab completion
✅ Async Performance - Region checking runs async to prevent lag

The plugin tracks player movement efficiently (only when crossing block boundaries) and triggers configured effects when entering new regions. All three example regions from your config are included with proper MiniMessage formatting.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
11 437
src/main/java/com/kodari/worldguardtitles/WorldGuardTitles.java
package com.kodari.worldguardtitles;

import com.kodari.worldguardtitles.command.ReloadCommand;
import com.kodari.worldguardtitles.listener.RegionListener;
import com.kodari.worldguardtitles.manager.ConfigManager;
import com.tcoded.folialib.FoliaLib;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class WorldGuardTitles extends JavaPlugin {
    private ConfigManager configManager;
    private FoliaLib foliaLib;
    private boolean hasPlaceholderAPI;
    private boolean hasWorldGuard;

    @Override
    public void onEnable() {
        hasWorldGuard = Bukkit.getPluginManager().getPlugin("WorldGuard") != null;
        if (!hasWorldGuard) {
            getLogger().severe("WorldGuard not found! Disabling plugin...");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        hasPlaceholderAPI = Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null;
        if (hasPlaceholderAPI) {
            getLogger().info("PlaceholderAPI found! Placeholder support enabled.");
        }

        saveDefaultConfig();

        this.foliaLib = new FoliaLib(this);

        this.configManager = new ConfigManager(this);
        configManager.loadConfig();

        Bukkit.getPluginManager().registerEvents(new RegionListener(this), this);

        ReloadCommand reloadCommand = new ReloadCommand(this);
        getCommand("worldguardtitles").setExecutor(reloadCommand);
        getCommand("worldguardtitles").setTabCompleter(reloadCommand);

        getLogger().info("WorldGuardTitles enabled successfully!");
    }

    @Override
    public void onDisable() {
        getLogger().info("WorldGuardTitles disabled.");
    }
}