pandagames7779

players: {} teams: {} homes: {} name: GreekGods version: 2.0 main: me.greekgods.GreekGods api-version: '1.21'

commands: team: usage: /team godcraft: usage: /godcraft

📎 2 files 10,720 chars
📄
pasted-code-1779716616500.txt
txt 91 lines
▶
package me.greekgods;

import org.bukkit.*;
import org.bukkit.entity.*;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

public enum GodType {

    ZEUS {
        public void skill(Player p) {

            World w = p.getWorld();

            w.strikeLightning(p.getLocation());

            w.spawnParticle(Particle.ELECTRIC_SPARK, p.getLocation(), 120, 1,1,1,0.2);
            w.playSound(p.getLocation(), Sound.ENTITY_LIGHTNING_BOLT_THUNDER, 1f, 1f);

            for(Entity e : p.getNearbyEntities(6,6,6)) {
                if(e instanceof LivingEntity le && e != p) {
                    w.strikeLightning(le.getLocation());
                    le.damage(6);
                }
            }
        }

        public void ultimate(Player p) {

            World w = p.getWorld();

            for(int i=0;i<10;i++) {
                Location loc = p.getLocation().clone().add(random(-8,8),0,random(-8,8));

                w.strikeLightning(loc);
                w.spawnParticle(Particle.ELECTRIC_SPARK, loc, 80);
            }

            w.playSound(p.getLocation(), Sound.ITEM_TRIDENT_THUNDER, 2f, 0.8f);
        }
    },

    HADES {
        public void skill(Player p) {

            Zombie z = p.getWorld().spawn(p.getLocation(), Zombie.class);
            z.setCustomName("§8Undead");

            p.getWorld().spawnParticle(Particle.SOUL, p.getLocation(), 120);
            p.getWorld().playSound(p.getLocation(), Sound.ENTITY_WITHER_SPAWN, 1f, 1f);
        }

        public void ultimate(Player p) {

            for(Entity e : p.getNearbyEntities(8,8,8)) {
                if(e instanceof LivingEntity le && e != p) {
                    le.addPotionEffect(new PotionEffect(PotionEffectType.WITHER,100,1));
                }
            }

            p.getWorld().spawnParticle(Particle.SOUL, p.getLocation(), 200);
        }
    },

    HERMES {
        public void skill(Player p) {
            p.setVelocity(p.getLocation().getDirection().multiply(2));
        }

        public void ultimate(Player p) {
            p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,200,4));
        }
    },

    POSEIDON {
        public void skill(Player p) {
            p.getWorld().spawnParticle(Particle.SPLASH, p.getLocation(), 100);
        }

        public void ultimate(Player p) {
            p.getWorld().spawnParticle(Particle.WATER_BUBBLE, p.getLocation(), 200);
        }
    };

    public abstract void skill(Player p);
    public abstract void ultimate(Player p);

    protected int random(int min, int max) {
        return (int)(Math.random()*(max-min+1))+min;
    }
}
📄
pasted-code-1779716627890.txt
txt 283 lines
▶
package me.greekgods;

import org.bukkit.*;
import org.bukkit.command.*;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.*;
import org.bukkit.event.*;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.*;
import org.bukkit.inventory.*;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

import java.util.*;
import java.util.stream.Collectors;

public class GreekGods extends JavaPlugin implements Listener, CommandExecutor {

    private final Map gods = new HashMap<>();
    private final Map> teams = new HashMap<>();
    private final Map playerTeam = new HashMap<>();
    private final Map homes = new HashMap<>();

    private final Map skillCD = new HashMap<>();
    private final Map ultCD = new HashMap<>();

    private static final int MAX_TEAM = 6;

    @Override
    public void onEnable() {

        Bukkit.getPluginManager().registerEvents(this, this);
        Objects.requireNonNull(getCommand("team")).setExecutor(this);

        saveDefaultConfig();
        loadData();

        startPassives();
        startNametags();
    }

    @Override
    public void onDisable() {
        saveData();
    }

    // ================= JOIN =================
    @EventHandler
    public void join(PlayerJoinEvent e) {

        Player p = e.getPlayer();

        gods.putIfAbsent(p.getUniqueId(),
                GodType.values()[new Random().nextInt(GodType.values().length)]
        );
    }

    // ================= ABILITIES =================
    @EventHandler
    public void use(PlayerInteractEvent e) {

        Player p = e.getPlayer();
        GodType g = gods.get(p.getUniqueId());
        if (g == null) return;

        if(e.getAction().toString().contains("RIGHT")) {

            if(cooldown(skillCD,p,10)) return;

            g.skill(p);
            skillCD.put(p.getUniqueId(), System.currentTimeMillis());
        }

        if(e.getAction().toString().contains("LEFT")) {

            if(cooldown(ultCD,p,60)) return;

            g.ultimate(p);
            ultCD.put(p.getUniqueId(), System.currentTimeMillis());
        }
    }

    private boolean cooldown(Map map, Player p, int sec) {

        long last = map.getOrDefault(p.getUniqueId(),0L);

        if(System.currentTimeMillis()-last < sec*1000L) {
            p.sendMessage("§cCooldown!");
            return true;
        }
        return false;
    }

    // ================= PASSIVES =================
    private void startPassives() {

        new BukkitRunnable() {
            public void run() {

                for(Player p : Bukkit.getOnlinePlayers()) {

                    GodType g = gods.get(p.getUniqueId());

                    if(g == GodType.HERMES)
                        p.addPotionEffect(new org.bukkit.potion.PotionEffect(
                                org.bukkit.potion.PotionEffectType.SPEED,40,0));

                    if(g == GodType.HADES &&
                            p.getWorld().getEnvironment()== World.Environment.NETHER)
                        p.addPotionEffect(new org.bukkit.potion.PotionEffect(
                                org.bukkit.potion.PotionEffectType.RESISTANCE,40,0));
                }
            }
        }.runTaskTimer(this,20,20);
    }

    // ================= NAMETAGS =================
    private void startNametags() {

        Bukkit.getScheduler().runTaskTimer(this, () -> {

            for(Player p : Bukkit.getOnlinePlayers()) {

                String team = playerTeam.getOrDefault(p.getUniqueId(),"NoTeam");
                GodType g = gods.get(p.getUniqueId());

                p.setPlayerListName("§8["+team+"] §6"+
                        (g!=null?g.name():"NONE")+" §f"+p.getName());
            }

        },20,20);
    }

    // ================= TEAM SYSTEM =================
    @Override
    public boolean onCommand(CommandSender s, Command c, String l, String[] a) {

        if(!(s instanceof Player p)) return true;

        if(c.getName().equalsIgnoreCase("team")) {

            if(a.length==0) return true;

            // CREATE
            if(a[0].equalsIgnoreCase("create")) {

                String name=a[1];

                teams.put(name,new ArrayList<>());
                teams.get(name).add(p.getUniqueId());
                playerTeam.put(p.getUniqueId(),name);

                p.sendMessage("Team created");
            }

            // JOIN
            if(a[0].equalsIgnoreCase("join")) {

                String t=a[1];

                if(!teams.containsKey(t)) return true;

                if(teams.get(t).size()>=MAX_TEAM) {
                    p.sendMessage("Team full");
                    return true;
                }

                teams.get(t).add(p.getUniqueId());
                playerTeam.put(p.getUniqueId(),t);

                p.sendMessage("Joined");
            }

            // HOME SET
            if(a[0].equalsIgnoreCase("sethome")) {

                String t=playerTeam.get(p.getUniqueId());
                if(t==null) return true;

                homes.put(t,p.getLocation());
                p.sendMessage("Home set");
            }

            // HOME
            if(a[0].equalsIgnoreCase("home")) {

                String t=playerTeam.get(p.getUniqueId());
                if(t==null || !homes.containsKey(t)) return true;

                p.teleport(homes.get(t));
                p.sendMessage("Teleported");
            }

            // INFO
            if(a[0].equalsIgnoreCase("info")) {

                String t=playerTeam.get(p.getUniqueId());
                if(t==null) return true;

                p.sendMessage("Team: "+t);

                for(UUID id:teams.get(t)) {
                    Player pl=Bukkit.getPlayer(id);
                    if(pl!=null)
                        p.sendMessage("- "+pl.getName());
                }
            }
        }

        return true;
    }

    // ================= SAVE =================
    private void saveData() {

        FileConfiguration cfg=getConfig();

        for(UUID id:gods.keySet())
            cfg.set("players."+id+".god",gods.get(id).name());

        for(String t:teams.keySet())
            cfg.set("teams."+t,
                    teams.get(t).stream().map(UUID::toString).collect(Collectors.toList())
            );

        for(String t:homes.keySet()) {

            Location l=homes.get(t);

            cfg.set("homes."+t+".world",l.getWorld().getName());
            cfg.set("homes."+t+".x",l.getX());
            cfg.set("homes."+t+".y",l.getY());
            cfg.set("homes."+t+".z",l.getZ());
        }

        saveConfig();
    }

    // ================= LOAD =================
    private void loadData() {

        FileConfiguration cfg=getConfig();

        if(cfg.getConfigurationSection("players")!=null) {

            for(String k:cfg.getConfigurationSection("players").getKeys(false)) {

                UUID id=UUID.fromString(k);

                gods.put(id,GodType.valueOf(cfg.getString("players."+k+".god")));
            }
        }

        if(cfg.getConfigurationSection("teams")!=null) {

            for(String t:cfg.getConfigurationSection("teams").getKeys(false)) {

                List list=cfg.getStringList("teams."+t)
                        .stream().map(UUID::fromString).toList();

                teams.put(t,list);

                for(UUID id:list)
                    playerTeam.put(id,t);
            }
        }

        if(cfg.getConfigurationSection("homes")!=null) {

            for(String t:cfg.getConfigurationSection("homes").getKeys(false)) {

                World w=Bukkit.getWorld(cfg.getString("homes."+t+".world"));

                if(w==null) continue;

                homes.put(t,new Location(w,
                        cfg.getDouble("homes."+t+".x"),
                        cfg.getDouble("homes."+t+".y"),
                        cfg.getDouble("homes."+t+".z")));
            }
        }
    }
}
Kodari AI
KodariMay 25 at 1:46 pm 13,054 (v2)

I’ll create a Greek mythology themed plugin with god powers, teams, and abilities.

GreekGods
A Greek mythology plugin where players are assigned powerful Greek gods with unique abilities. Each god has a skill and ultimate ability with cooldowns. Players can form teams with up to 6 members, set team homes, and teleport back. Features include Zeus lightning strikes, Hades undead summoning, Hermes speed boosts, and Poseidon water powers. Includes passive effects and automatic god assignment on join.

I’ll restructure your existing code with proper architecture, XSeries compatibility, and better organization:


Project complete! Your Greek mythology plugin with proper structure:

✅ XSeries integration - All particles, sounds, and potions are cross-version compatible
✅ Manager architecture - Separate managers for gods, teams, cooldowns, and data
✅ Command system - /team and /god commands with full functionality
✅ Task scheduling - Passive effects and nametag updates run on timers
✅ Configuration - All messages and settings in config.yml
✅ Data persistence - Gods, teams, and homes save/load automatically
✅ Lombok - Clean code with @Getter annotations

Players spawn with random god powers, can form teams, set homes, and unleash abilities with cooldowns!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 929
src/main/java/me/greekgods/GreekGods.java
package me.greekgods;

import lombok.Getter;
import me.greekgods.command.GodCommand;
import me.greekgods.command.TeamCommand;
import me.greekgods.listener.AbilityListener;
import me.greekgods.listener.PlayerListener;
import me.greekgods.manager.CooldownManager;
import me.greekgods.manager.DataManager;
import me.greekgods.manager.GodManager;
import me.greekgods.manager.TeamManager;
import me.greekgods.task.NametagTask;
import me.greekgods.task.PassiveTask;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public class GreekGods extends JavaPlugin {
    
    @Getter private GodManager godManager;
    @Getter private TeamManager teamManager;
    @Getter private CooldownManager cooldownManager;
    @Getter private DataManager dataManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.godManager = new GodManager(this);
        this.teamManager = new TeamManager(this);
        this.cooldownManager = new CooldownManager(this);
        this.dataManager = new DataManager(this);
        
        dataManager.load();
        
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
        Bukkit.getPluginManager().registerEvents(new AbilityListener(this), this);
        
        Objects.requireNonNull(getCommand("team")).setExecutor(new TeamCommand(this));
        Objects.requireNonNull(getCommand("god")).setExecutor(new GodCommand(this));
        
        new PassiveTask(this).runTaskTimer(this, 20L, 20L);
        new NametagTask(this).runTaskTimer(this, 20L, 20L);
        
        getLogger().info("GreekGods plugin enabled!");
    }
    
    @Override
    public void onDisable() {
        dataManager.save();
        getLogger().info("GreekGods plugin disabled!");
    }
    
    public String getMessage(String key) {
        String prefix = getConfig().getString("messages.prefix", "&6[GreekGods] &r");
        String message = getConfig().getString("messages." + key, "&cMessage not found: " + key);
        return colorize(prefix + message);
    }
    
    public String colorize(String text) {
        return text.replace('&', '§');
    }
}