zeph0170

Çekiliş

Kodari AI
KodariJan 21 at 9:17 am 6,935 (v2)

I’ll create a comprehensive giveaway/raffle plugin for your Minecraft server.

GiveawayPlugin
A feature-rich giveaway and raffle system for Minecraft servers. Allows administrators to create timed giveaways with customizable rewards, participant requirements, and entries. Players can join giveaways with commands, view active raffles, and receive automatic notifications. Supports multiple concurrent giveaways, permission-based restrictions, winner selection, and reward distribution. Includes configurable messages, cooldowns, and entry limits.

✅ GiveawayPlugin created successfully!

Features:

  • Create timed giveaways with custom rewards

  • Players join/leave giveaways with commands

  • Automatic winner selection when time expires

  • Multiple concurrent giveaways support

  • Configurable entry limits and durations

  • Auto-announcements at intervals

  • Turkish command alias support (/çekiliş)

Commands:

  • /giveaway create <duration> <reward> [maxEntries] - Create giveaway

  • /giveaway join <id> - Join giveaway

  • /giveaway leave <id> - Leave giveaway

  • /giveaway list - View active giveaways

  • /giveaway end <id> - Manually end giveaway

  • /giveaway cancel <id> - Cancel giveaway

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 611
src/main/java/com/giveaway/GiveawayPlugin.java
package com.giveaway;

import com.giveaway.command.GiveawayCommand;
import com.giveaway.manager.GiveawayManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class GiveawayPlugin extends JavaPlugin {
    
    private GiveawayManager giveawayManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.giveawayManager = new GiveawayManager(this);
        
        getCommand("giveaway").setExecutor(new GiveawayCommand(this));
        
        getLogger().info("GiveawayPlugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (giveawayManager != null) {
            giveawayManager.shutdown();
        }
        getLogger().info("GiveawayPlugin has been disabled!");
    }
    
    public String getMessage(String path) {
        String prefix = getConfig().getString("prefix", "&6[Giveaway] &r");
        String message = getConfig().getString("messages." + path, path);
        return colorize(prefix + message);
    }
    
    public String getMessageRaw(String path) {
        String message = getConfig().getString("messages." + path, path);
        return colorize(message);
    }
    
    public String colorize(String text) {
        return text.replace('&', '§');
    }
}