cjcool3003

Please make a plugin for versions 1.21.4-1.21.11 for papermc which when a new user joins the server for the first time other members can type /welcome to welcome them where a customisable message is sent that welcomes them and as a reward for welcoming someone the user who typed the command (if valid) gets a customisable command reward, the initial welcome message will be displayed to the whole server and the person who gets welcomed will run a command and the welcomer will get a command run as well, when the new user joins there is 10 minutes for people to welcome them till they can no longer welcome them., there is a /welcome reload command which reloads the plugin with the requiredpermission welcomer.reload and the welcome command requires the permission welcomer.welcome if a restart occours log the data if a player has previously joined for the first time, please add a placeholder for the welcomer the user thats getting welcomed

Kodari AI
KodariJun 23 at 9:50 pm 9

I’ll create a welcoming system plugin with time-limited greetings and rewards.

Welcomer
A welcoming system that rewards players for greeting new members. When a player joins for the first time, others have 10 minutes to type /welcome and earn rewards. Features customizable messages, command rewards for both welcomer and welcomed players, and persistent data tracking across restarts with PlaceholderAPI support.

Done! Created a complete welcoming system with these features:

Core Functionality:

  • Tracks first-time players and prevents re-welcoming across restarts

  • 10-minute time window (configurable) to welcome new players

  • One welcome per player (prevents spam)

  • Server-wide announcement when new player joins

  • Customizable command rewards for both welcomer and welcomed player

Commands:

  • /welcome - Welcome the new player (permission: welcomer.welcome)

  • /welcome reload - Reload configuration (permission: welcomer.reload)

Placeholders (via PlaceholderAPI):

  • %welcomer_welcomed% - Current new player’s name

  • %welcomer_isactive% - Whether welcome period is active

Data Persistence:

  • Stores previous players in data.yml to survive restarts

  • Auto-saves when new players join

Configuration: All messages and rewards are customizable in config.yml, with placeholders %welcomer% and %welcomed% supported throughout.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
12 572
src/main/java/com/welcomer/WelcomerPlugin.java
package com.welcomer;

import com.welcomer.commands.WelcomeCommand;
import com.welcomer.listeners.PlayerJoinListener;
import com.welcomer.managers.ConfigManager;
import com.welcomer.managers.DataManager;
import com.welcomer.managers.WelcomeManager;
import com.welcomer.placeholder.WelcomerExpansion;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class WelcomerPlugin extends JavaPlugin {
    
    private ConfigManager configManager;
    private DataManager dataManager;
    private WelcomeManager welcomeManager;
    
    @Override
    public void onEnable() {
        // Initialize managers
        this.configManager = new ConfigManager(this);
        this.dataManager = new DataManager(this);
        this.welcomeManager = new WelcomeManager(this);
        
        // Load data
        this.dataManager.load();
        
        // Register commands
        getCommand("welcome").setExecutor(new WelcomeCommand(this));
        
        // Register listeners
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        
        // Register PlaceholderAPI expansion if available
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new WelcomerExpansion(this).register();
            getLogger().info("PlaceholderAPI hooked successfully!");
        }
        
        getLogger().info("Welcomer plugin enabled!");
    }
    
    @Override
    public void onDisable() {
        // Save data on shutdown
        if (dataManager != null) {
            dataManager.save();
        }
        
        getLogger().info("Welcomer plugin disabled!");
    }
    
    public void reload() {
        configManager.reload();
        dataManager.load();
        getLogger().info("Configuration reloaded!");
    }
}