luff0x

crée ce plugin

📎 1 file 2,891 chars
📄
pasted-code-1773565701220.txt
txt 222 lines
▶
🌟 StarSMP – Règles et systèmes principaux

StarSMP est un SMP PvP basé sur les kills avec :

⭐ un classement Star

🗡️ des épées spéciales

⚖️ des restrictions pour équilibrer le PvP

Le but du serveur :

👑 Devenir Star 1 (le joueur avec le plus de kills).

⭐ Système de Star

Les rangs sont basés sur les kills PvP.

⭐ Star 1 → joueur avec le plus de kills
⭐ Star 2 → deuxième joueur
⭐ Star 3 → troisième joueur
⭐ etc…

📌 Chaque Star est unique.

Deux joueurs ne peuvent jamais avoir le même Star.

⭐ Star 0

Les joueurs avec 0 kill sont :

Star 0

Ils ne sont pas encore classés.

📈 Mise à jour des Stars

Quand un joueur tue un autre joueur :

le tueur gagne +1 kill

la victime perd 1 kill (minimum 0)

Si un joueur dépasse quelqu’un :

➡️ les joueurs échangent automatiquement leur Star

Le classement se met à jour dans :

TAB

Nametag

INVENTORY GUI classement

📊 Commande classement

Commande pour tous les joueurs :

/ranks

Elle ouvre un Inventory INVENTORY GUI avec :

la tête des joueurs

leur Star

leur nombre de kills

Les joueurs ne peuvent pas prendre les items dans le INVENTORY GUI.

✔ seuls les admins peuvent modifier les INVENTORY GUI.

🎯 Commande Admin

Commande admin :

/givekill  

📌 Seuls les admins peuvent utiliser cette commande.

Elle permet de :

donner des kills à un joueur

modifier son Star

Quand la commande est utilisée :

➡️ tout le classement se met à jour automatiquement

TAB

Nametag

INVENTORY GUI classement

💪 Pouvoirs des Stars

⭐ Star 1

Force I permanente

Speed I permanente

⭐ Star 2

Fire Resistance permanente

Speed I permanente

⭐ Star 3

Speed I permanente

Quand un joueur change de Star :

➡️ les anciens effets sont retirés automatiquement.

🧪 Potions

❌ Les joueurs ne peuvent pas avoir Force II.

Si un joueur utilise une potion Force II :

➡️ elle est automatiquement remplacée par Force I.

🗡️ Épées spéciales

Commande admin :

/Starsmp:SWORD

Ouvre un INVENTORY GUI avec les épées spéciales.

⚔️ Dégâts équilibrés (Protection III)

Les joueurs seront en général en :

💎 diamant Protection III

Les dégâts sont équilibrés pour être forts mais sans one-shot.

👁️ Épée du Warden

Pouvoir :

Sonic Boom

Dégâts :

❤️ 4 cœurs en full diamant Protection III

Cooldown :

3 minutes

🐉 Épée du Dragon

Pouvoir :

boule de feu

explosion

feu

Dégâts :

❤️ 5 cœurs en diamant Protection III

Cooldown :

2 minutes

⚡ Épée du Tonnerre

Pouvoir :

fait spawn 2 éclairs sur le joueur

Chaque éclair :

❤️ 2 cœurs

Si les 2 touchent :

❤️ 4 cœurs

Cooldown :

2 minutes

🚫 Restrictions PvP

Pour équilibrer le serveur :

❌ Protection IV interdite
❌ Ender Pearls interdites
❌ Mace interdite

🔨 StarMace

Seule mace autorisée :

StarMace

Commande admin :

/starmace

Impossible à craft.

📦 Limites d’items

Maximum autorisé :

🧪 1 stack de fioles d’XP

🍎 2 stacks de Golden Apples

🔔 2 stacks de Cowbells
Kodari AI
KodariMar 15 at 9:13 am 25,794 (v2)

I’ll create a comprehensive StarSMP plugin with a star ranking system, special swords, and PvP restrictions.

StarSMP
A competitive PvP SMP plugin featuring dynamic star rankings based on kills, special weapons with unique abilities, automatic power effects for top players, and balanced PvP restrictions. Players compete to become Star 1 by earning kills while managing cooldowns on legendary swords including Warden, Dragon, and Thunder variants. Includes inventory limits, potion restrictions, and a full GUI ranking system with real-time TAB and nametag updates.

I’ll create a comprehensive StarSMP plugin with ranking system, special swords, and PvP restrictions using the GUI framework and Cloud commands.

All files created successfully! StarSMP plugin is complete with:

  • Dynamic star ranking system based on PvP kills

  • Three special swords (Warden, Dragon, Thunder) with unique abilities and cooldowns

  • Star powers (Strength/Speed/Fire Resistance) for top 3 players

  • PvP restrictions (Protection IV, Ender Pearls, Mace blocking)

  • Item limits (XP bottles, Golden Apples, Cowbells)

  • Strength II potion blocking

  • GUI ranking display with player heads

  • Admin commands using Cloud command framework

  • Automatic data saving and player display updates

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
27 1,518
src/main/java/com/starsmp/StarSMP.java
package com.starsmp;

import com.starsmp.commands.GiveKillCommand;
import com.starsmp.commands.RanksCommand;
import com.starsmp.commands.StarMaceCommand;
import com.starsmp.commands.SwordCommand;
import com.starsmp.inventory.gui.GUIListener;
import com.starsmp.inventory.gui.GUIManager;
import com.starsmp.listeners.*;
import com.starsmp.managers.DataManager;
import com.starsmp.managers.EffectManager;
import com.starsmp.managers.StarManager;
import com.starsmp.managers.SwordManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class StarSMP extends JavaPlugin {
    private DataManager dataManager;
    private StarManager starManager;
    private EffectManager effectManager;
    private SwordManager swordManager;
    private GUIManager guiManager;

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

        this.dataManager = new DataManager(this);
        this.starManager = new StarManager(this);
        this.effectManager = new EffectManager(this);
        this.swordManager = new SwordManager(this);
        this.guiManager = new GUIManager();

        this.dataManager.loadAllOnlinePlayers();
        this.starManager.updateAllRankings();

        registerListeners();
        registerCommands();

        startAutoSave();

        getLogger().info("StarSMP has been enabled!");
    }

    @Override
    public void onDisable() {
        this.dataManager.saveAllData();
        getLogger().info("StarSMP has been disabled!");
    }

    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new PvPListener(this), this);
        Bukkit.getPluginManager().registerEvents(new RestrictionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PotionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ItemLimitListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerConnectionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new GUIListener(this.guiManager), this);
    }

    private void registerCommands() {
        getCommand("ranks").setExecutor(new RanksCommand(this));
        getCommand("givekill").setExecutor(new GiveKillCommand(this));
        getCommand("starmace").setExecutor(new StarMaceCommand(this));
        getCommand("sword").setExecutor(new SwordCommand(this));
    }

    private void startAutoSave() {
        int interval = getConfig().getInt("settings.save_interval", 300) * 20;
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            this.dataManager.saveAllData();
            getLogger().info("Auto-saved all player data");
        }, interval, interval);
    }
}