Silahi Badrane

Fais moi un plugin pour mon smp END SMP weapon custom etc

Kodari AI
KodariMon at 10:46 am 3
EndSmpCustomWeapons
A Minecraft SMP plugin that adds custom weapon crafting, unique abilities, and rarity tiers. Players can craft legendary swords, bows, and axes with special effects like fire aspect, lightning strikes, and lifesteal. Includes a GUI-based crafting station, weapon upgrade system using rare materials, and balanced cooldowns. Weapons display custom lore, glowing enchant effects, and particle trails when equipped. Configurable drop rates from mobs and boss fights, with persistent weapon data stored per player.
  • Trois armes de l’End avec recettes et pouvoirs.

  • Commande administrateur pour les obtenir et réglages dans config.yml.

Plugin EndSMP créé avec trois armes : l’épée du Néant, la hache de l’End et le sceptre du Dragon. Chacune possède un pouvoir et une recette : souffle de dragon, arme de base et étoile du Nether, placés verticalement.

  • /endweapon give <joueur> <epee|hache|sceptre> : donner une arme.

  • /endweapon reload : recharger la configuration.

  • Les dégâts et temps de recharge sont réglables dans config.yml.

Silahi Badrane

END MACE enchant custom tt la total un plugin complet

Kodari AI
KodariMon at 10:48 am 3

Je vais ajouter une End Mace avec son pouvoir, puis des enchantements personnalisés configurables et les commandes pour les appliquer.

J’ai ajouté l’End Mace, avec une onde de choc au clic droit et une recette utilisant une masse, du souffle de dragon et une étoile du Nether. Elle nécessite Minecraft 1.21 ou plus récent.

Trois enchantements personnalisés sont disponibles pour les armes EndSMP : Néant (dégâts), Gel (ralentissement) et Vol de vie (soins).

  • /endweapon give <joueur> mace

  • /endweapon enchant <neant|gel|voldevie> <1-5> — tiens l’arme en main.

  • /endweapon reload

Les effets et délais sont réglables dans config.yml.

Silahi Badrane

pour un smp avc des particule etc etc un bopn avc un twist genre on peut achete des effet dans la boutique etc

Kodari AI
KodariMon at 10:50 am 4
  1. Ajouter des fragments de l’End gagnés en jeu et conservés entre les redémarrages.

  2. Créer une boutique d’effets avec achat, activation et particules.

  3. Ajouter des réglages et des commandes d’administration.

Le twist d’EndSMP est en place : gagne des fragments de l’End en éliminant des Endermen ou des joueurs, puis dépense-les dans une boutique d’effets avec particules.

  • /endsmp boutique : acheter, activer ou désactiver un effet.

  • /endsmp solde : voir tes fragments.

  • /endsmp give <joueur> <montant> : donner des fragments en tant qu’admin.

Les achats et soldes sont sauvegardés. Les prix, récompenses et effets sont réglables dans config.yml. Un délai limite les récompenses répétées sur une même victime.

Silahi Badrane

refai tt en anglais c un smp Anglais

Kodari AI
KodariMon at 10:53 am 4
  • Traduire les messages, la boutique et les noms par défaut en anglais.

  • Ajouter des commandes en anglais tout en conservant les anciennes données et commandes.

Le plugin est maintenant en anglais : messages, boutique, armes et enchantements.

  • /endsmp shop et /endsmp balance

  • /endweapon give <player> <sword|axe|scepter|mace>

  • /endweapon enchant <void|frost|lifesteal> <1-5>

Les données et anciennes commandes restent compatibles. Les armes déjà créées conservent leur ancien nom et leur description ; les nouvelles seront en anglais.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 634
src/main/java/fr/endsmp/EndSMP.java
package fr.endsmp;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.SmallFireball;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public final class EndSMP extends JavaPlugin implements Listener {
    private NamespacedKey weaponKey;
    private final Map<UUID, Map<String, Long>> cooldowns = new HashMap<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        translateDefaultNames();
        weaponKey = new NamespacedKey(this, "weapon");
        getServer().getPluginManager().registerEvents(this, this);
        EndShop shop = new EndShop(this);
        getServer().getPluginManager().registerEvents(shop, this);
        getCommand("endsmp").setExecutor(shop);
        shop.start();
        registerRecipes();
    }

    private Material material(String name) {
        return XMaterial.matchXMaterial(name).map(XMaterial::parseMaterial)
                .orElseThrow(() -> new IllegalStateException("Material not found: " + name));
    }

    private void translateDefaultNames() {
        String[][] names = {
                {"armes.epee.nom", "&5Épée du Néant", "&5Void Sword"},
                {"armes.hache.nom", "&dHache de l'End", "&dEnd Axe"},
                {"armes.sceptre.nom", "&5Sceptre du Dragon", "&5Dragon Scepter"},
                {"boutique.effets.vitesse.nom", "&dVitesse du Néant", "&dVoid Speed"},
                {"boutique.effets.saut.nom", "&5Bond de l'End", "&5End Leap"},
                {"boutique.effets.resistance.nom", "&dPeau du Dragon", "&dDragon Skin"}
        };
        boolean changed = false;
        for (String[] name : names) {
            if (name[1].equals(getConfig().getString(name[0]))) {
                getConfig().set(name[0], name[2]);
                changed = true;
            }
        }
        if (changed) saveConfig();
    }

    private String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }

    private ItemStack weapon(String type) {
        String material;
        String ability;
        switch (type) {
            case "epee":
                material = "NETHERITE_SWORD";
                ability = "&7Right-click: Void dash";
                break;
            case "hache":
                material = "NETHERITE_AXE";
                ability = "&7Right-click: Strike your target with lightning";
                break;
            case "sceptre":
                material = "BLAZE_ROD";
                ability = "&7Right-click: Launch a fireball";
                break;
            case "mace":
                material = "MACE";
                ability = "&7Right-click: End shockwave";
                if (XMaterial.matchXMaterial(material).map(XMaterial::parseMaterial).orElse(null) == null) return null;
                break;
            default:
                return null;
        }
        ItemStack item = new ItemStack(material(material));
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(color(getConfig().getString("armes." + type + ".nom", type)));
        meta.setLore(Arrays.asList(color("&8Legendary End weapon"), color(ability)));
        meta.getPersistentDataContainer().set(weaponKey, PersistentDataType.STRING, type);
        item.setItemMeta(meta);
        return item;
    }

    private String weaponType(ItemStack item) {
        if (item == null || !item.hasItemMeta()) return null;
        String type = item.getItemMeta().getPersistentDataContainer().get(weaponKey, PersistentDataType.STRING);
        if ("epee".equals(type) || "hache".equals(type) || "sceptre".equals(type) || "mace".equals(type)) return type;
        return null;
    }

    private void registerRecipes() {
        recipe("epee", " E ", " S ", " N ", "NETHERITE_SWORD");
        recipe("hache", " E ", " S ", " N ", "NETHERITE_AXE");
        recipe("sceptre", " E ", " S ", " N ", "BLAZE_ROD");
        if (XMaterial.matchXMaterial("MACE").map(XMaterial::parseMaterial).orElse(null) != null) {
            recipe("mace", " E ", " S ", " N ", "MACE");
        } else {
            getLogger().warning("End Mace unavailable: Minecraft 1.21 or newer is required.");
        }
    }

    private void recipe(String type, String top, String middle, String bottom, String base) {
        NamespacedKey key = new NamespacedKey(this, type);
        Bukkit.removeRecipe(key);
        ShapedRecipe recipe = new ShapedRecipe(key, weapon(type));
        recipe.shape(top, middle, bottom);
        recipe.setIngredient('E', material("DRAGON_BREATH"));
        recipe.setIngredient('S', material(base));
        recipe.setIngredient('N', material("NETHER_STAR"));
        Bukkit.addRecipe(recipe);
    }

    @EventHandler(ignoreCancelled = true)
    public void onDamage(EntityDamageByEntityEvent event) {
        if (!(event.getDamager() instanceof Player)) return;
        Player player = (Player) event.getDamager();
        String type = weaponType(player.getInventory().getItemInMainHand());
        if (type != null) {
            event.setDamage(event.getDamage() + Math.max(0, getConfig().getDouble("armes." + type + ".degats-bonus")));
            ItemMeta meta = player.getInventory().getItemInMainHand().getItemMeta();
            int neant = enchantLevel(meta, "neant");
            event.setDamage(event.getDamage() + neant * Math.max(0, getConfig().getDouble("enchantements.neant.degats-par-niveau", 1.5)));
            if (event.getEntity() instanceof LivingEntity) {
                LivingEntity target = (LivingEntity) event.getEntity();
                int gel = enchantLevel(meta, "gel");
                if (gel > 0) {
                    int duration = Math.max(1, getConfig().getInt("enchantements.gel.duree-secondes", 3)) * 20;
                    XPotion.matchXPotion("SLOWNESS").map(potion -> potion.buildPotionEffect(duration, gel - 1)).ifPresent(target::addPotionEffect);
                }
                int vol = enchantLevel(meta, "voldevie");
                if (vol > 0) {
                    double healing = vol * Math.max(0, getConfig().getDouble("enchantements.voldevie.soins-par-niveau", 1.0));
                    player.setHealth(Math.min(player.getMaxHealth(), player.getHealth() + healing));
                }
            }
        }
    }

    private int enchantLevel(ItemMeta meta, String enchantment) {
        Integer level = meta.getPersistentDataContainer().get(new NamespacedKey(this, "enchant_" + enchantment), PersistentDataType.INTEGER);
        return level == null ? 0 : Math.max(0, Math.min(5, level));
    }

    private void applyEnchant(ItemStack item, String enchantment, int level) {
        ItemMeta meta = item.getItemMeta();
        meta.getPersistentDataContainer().set(new NamespacedKey(this, "enchant_" + enchantment), PersistentDataType.INTEGER, level);
        List<String> lore = new ArrayList<>(Arrays.asList(color("&8Legendary End weapon"),
                color(weaponAbility(weaponType(item)))));
        for (String name : Arrays.asList("neant", "gel", "voldevie")) {
            int current = enchantLevel(meta, name);
            if (current > 0) lore.add(color("&d✦ " + enchantName(name) + " " + current));
        }
        meta.setLore(lore);
        item.setItemMeta(meta);
    }

    private String weaponAbility(String type) {
        switch (type) {
            case "epee": return "&7Right-click: Void dash";
            case "hache": return "&7Right-click: Strike your target with lightning";
            case "sceptre": return "&7Right-click: Launch a fireball";
            default: return "&7Right-click: End shockwave";
        }
    }

    private String enchantName(String name) {
        switch (name) {
            case "neant": return "Void";
            case "gel": return "Frost";
            default: return "Lifesteal";
        }