nacho_ninja1
šŸ“Ž 1 file 2,108 chars
šŸ“„
pasted-code-1791043028786.txt
txt 77 lines
ā–¶
Create a complete standalone Paper 1.21.11 Minecraft plugin called WaffleJoinMessages.

The plugin is for WAFFLE SMP.

MAIN FEATURE:
Create custom join and leave messages based on the player's LuckPerms rank.

MEMBER / DEFAULT:
When a normal player joins:
"šŸ“ WAFFLE SMP Ā» Welcome, {player}!"

When a normal player leaves:
"šŸ“ WAFFLE SMP Ā» {player} has left!"

OWNER:
When the OWNER joins, make it much more special than MEMBER:
"šŸ‘‘ WAFFLE SMP Ā» OWNER {player} has entered the server!"

When the OWNER leaves:
"šŸ‘‘ WAFFLE SMP Ā» OWNER {player} has left the server!"

OWNER messages should have a premium/golden style and clearly stand out from normal players.

RANKS:
Support these LuckPerms groups:
- owner
- developer
- admin
- mod
- helper
- media
- vip
- member
- default

Give every rank its own configurable join and leave message.

IMPORTANT:
- Detect ranks using LuckPerms.
- Do NOT hardcode a specific player's username.
- Use the player's actual username with {player}.
- If a player has no special rank, use the MEMBER/default message.
- Highest-priority rank should be used if a player has multiple groups.
- Use PlaceholderAPI if available.
- Use MiniMessage for colors, gradients, bold text, emojis, etc.
- Messages must support RGB/hex colors.
- Do not display raw formatting codes.
- Broadcast the message to everyone online.
- Do not send the normal vanilla "Steve joined the game" or "Steve left the game" message.
- Work on Paper 1.21.11.
- Java 21.
- Maven project.
- Include plugin.yml.
- Include complete source code.
- Include pom.xml.
- Make it compile into WaffleJoinMessages.jar with:
  mvn clean package

CONFIGURATION:
Everything must be editable in config.yml:
- join messages
- leave messages
- rank priority
- colors
- emojis
- enabled/disabled ranks
- fallback/default message

Also add:
 /wafflejoin reload

Permission:
wafflejoin.admin

Make the plugin lightweight and avoid unnecessary repeating tasks.
Do not require EssentialsX.
LuckPerms should be the only required dependency for rank detection.
Kodari AI
KodariOct 3 at 4:02 pm 1
WaffleJoinMessages
A lightweight Paper 1.21.11 plugin that broadcasts custom join and leave messages based on the player's LuckPerms rank. Supports nine configurable ranks (owner, developer, admin, mod, helper, media, vip, member, default) with distinct premium styling for higher-tier ranks. Uses MiniMessage for RGB colors, gradients, and emojis, with PlaceholderAPI integration when available. Features a fully editable config.yml for messages, rank priority, and enabled/disabled ranks, plus a /wafflejoin reload command with wafflejoin.admin permission. Automatically suppresses vanilla join/leave messages and selects the highest-priority rank for players with multiple groups.
  1. Create the Maven project for Java 21 and Paper 1.21.11.

  2. Add LuckPerms-priority rank resolution, configurable MiniMessage join/leave broadcasts, and optional PlaceholderAPI expansion.

  3. Register /wafflejoin reload with wafflejoin.admin.

Created WaffleJoinMessages with configurable MiniMessage join and leave broadcasts for all nine LuckPerms ranks, rank-priority selection, optional PlaceholderAPI expansion, and /wafflejoin reload guarded by wafflejoin.admin.

The Maven project targets Java 21 and Paper 1.21.11 and is configured to produce WaffleJoinMessages.jar with mvn clean package. LuckPerms is the only required plugin dependency.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
8 348
src/main/java/com/wafflesmp/wafflejoinmessages/WaffleJoinMessagesPlugin.java
package com.wafflesmp.wafflejoinmessages;

import com.wafflesmp.wafflejoinmessages.command.WaffleJoinCommand;
import com.wafflesmp.wafflejoinmessages.listener.JoinMessageListener;
import com.wafflesmp.wafflejoinmessages.message.MessageFormatter;
import com.wafflesmp.wafflejoinmessages.rank.RankResolver;
import net.luckperms.api.LuckPerms;
import net.luckperms.api.LuckPermsProvider;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class WaffleJoinMessagesPlugin extends JavaPlugin {

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

        LuckPerms luckPerms;
        try {
            luckPerms = LuckPermsProvider.get();
        } catch (IllegalStateException exception) {
            getLogger().severe("LuckPerms is required but its API could not be accessed. Disabling plugin.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        RankResolver rankResolver = new RankResolver(this, luckPerms);
        MessageFormatter messageFormatter = new MessageFormatter(this);
        Bukkit.getPluginManager().registerEvents(new JoinMessageListener(rankResolver, messageFormatter), this);

        WaffleJoinCommand command = new WaffleJoinCommand(this);
        if (getCommand("wafflejoin") != null) {
            getCommand("wafflejoin").setExecutor(command);
        }

        getLogger().info("WaffleJoinMessages enabled.");
    }
}