salut
Salut ! Qu’est-ce que tu veux construire aujourd’hui ? Un plugin Minecraft, un bot Discord, ou autre chose ?
plugin mincecraft j'est envie de crer un plugin de pouvoir /class avec skript
Voici le plugin complet :
Plugin créé avec :
Classe | Passif | Actif |
|---|---|---|
🗡️ Guerrier | Résistance I | Régénération II au kill |
🔥 Mage | Force I | Feu au contact |
🏹 Archer | Rapidité I | Flèches x1.5 dégâts |
🌑 Assassin | Vision nocturne | +30% dégâts dans le dos |
Commandes :
/class→ ouvre le GUI de sélection/class info→ affiche ta classe actuelle
Les classes sont sauvegardées dans playerdata.yml et réappliquées à la reconnexion.
masi moi jutilise skript en .sk est delux menu en /yml
Pas de souci ! Voilà avec Skript + DeluxeMenus :
Ce qu’il te faut :
Plugin | Rôle |
|---|---|
Skript | Logique des classes |
DeluxeMenus | GUI /class |
SkBee ou SkQuery | Lecture/écriture YAML |
Commandes :
/class→ ouvre le menu (géré par DeluxeMenus)/classinfo→ affiche ta classe actuelle
Les données sont sauvegardées dans plugins/Skript/data/classes.yml. Tu veux ajouter une classe Assassin au menu ou modifier autre chose ?
javais ca
📄
pasted-code-1782419995909.txt
txt
223 lines
▶
# ============================================
# CLASSE GUERRIER - Skript pur 1.20.1
# ============================================
# ============================================
# REJOINDRE LA CLASSE
# ============================================
command /classe guerrier:
trigger:
if {classe::%uuid of player%} is set:
send "&cTu as deja une classe !" to player
stop
set {classe::%uuid of player%} to "guerrier"
set {niveau::%uuid of player%} to 1
set {xp::%uuid of player%} to 0
set {sort::%uuid of player%} to "boulefeu"
send "&6&l*** CLASSE GUERRIER DEBLOQUEE ***" to player
send "&7Sort actif : &6Boule de Feu" to player
send "&7Tape &e/sorts &7pour changer de sort." to player
# ============================================
# XP ET NIVEAUX
# ============================================
on level up:
if {classe::%uuid of player%} is "guerrier":
if {niveau::%uuid of player%} >= 20:
stop
add 1 to {xp::%uuid of player%}
set {_lvl} to {niveau::%uuid of player%}
set {_xp} to {xp::%uuid of player%}
set {_requis} to {_lvl} * 5
send "&7[&6Guerrier&7] XP : &e%{_xp}%&7/&e%{_requis}%" to player
if {_xp} >= {_requis}:
add 1 to {niveau::%uuid of player%}
set {xp::%uuid of player%} to 0
set {_newlvl} to {niveau::%uuid of player%}
send "&6&l*** NIVEAU %{_newlvl}% ATTEINT ! ***" to player
if {_newlvl} is 2:
execute console command "eco give %player% 500"
send "&a+500$ gagnes !" to player
if {_newlvl} is 3:
execute console command "eco give %player% 500"
send "&a+500$ gagnes !" to player
if {_newlvl} is 4:
execute console command "eco give %player% 500"
send "&a+500$ gagnes !" to player
if {_newlvl} is 5:
send "&aSort debloques : &bBouclier ! &7(/sorts)" to player
if {_newlvl} is 10:
send "&aSort debloques : &dGlissade ! &7(/sorts)" to player
if {_newlvl} is 15:
send "&aSort debloques : &cGlissade de Feu ! &7(/sorts)" to player
if {_newlvl} is 20:
send "&aSort debloques : &4Pluie de Meteorites ! &7(/sorts)" to player
# ============================================
# COMMANDE /niveau
# ============================================
command /niveau:
trigger:
if {classe::%uuid of player%} is not set:
send "&cTu n'as pas de classe !" to player
stop
set {_lvl} to {niveau::%uuid of player%}
set {_xp} to {xp::%uuid of player%}
set {_requis} to {_lvl} * 5
send "&6&l*** GUERRIER Niv.%{_lvl}%/20 ***" to player
send "&7XP : &e%{_xp}%&7/&e%{_requis}%" to player
send "&7Sort actif : &e%{sort::%uuid of player%}%" to player
# ============================================
# COMMANDE /sorts
# ============================================
command /sorts:
trigger:
if {classe::%uuid of player%} is not set:
send "&cTu n'as pas de classe !" to player
stop
execute console command "deluxemenus open sorts %player%"
# ============================================
# CHANGER DE SORT
# ============================================
command /activersort :
trigger:
set {_s} to arg-1
if {_s} is "boulefeu":
set {sort::%uuid of player%} to "boulefeu"
send "&6Sort actif : Boule de Feu !" to player
else if {_s} is "bouclier":
if {niveau::%uuid of player%} >= 5:
set {sort::%uuid of player%} to "bouclier"
send "&bSort actif : Bouclier !" to player
else:
send "&cNiveau 5 requis !" to player
else if {_s} is "glissade":
if {niveau::%uuid of player%} >= 10:
set {sort::%uuid of player%} to "glissade"
send "&dSort actif : Glissade !" to player
else:
send "&cNiveau 10 requis !" to player
else if {_s} is "glissadefeu":
if {niveau::%uuid of player%} >= 15:
set {sort::%uuid of player%} to "glissadefeu"
send "&cSort actif : Glissade de Feu !" to player
else:
send "&cNiveau 15 requis !" to player
else if {_s} is "meteores":
if {niveau::%uuid of player%} >= 20:
set {sort::%uuid of player%} to "meteores"
send "&4Sort actif : Pluie de Meteorites !" to player
else:
send "&cNiveau 20 requis !" to player
# ============================================
# ACTION BAR - cooldown ou pret
# ============================================
every 1 second:
loop all players:
if {classe::%uuid of loop-player%} is "guerrier":
set {_s} to {sort::%uuid of loop-player%}
if {_s} is "boulefeu":
set {_nom} to "&6Boule de Feu"
else if {_s} is "bouclier":
set {_nom} to "&bBouclier"
else if {_s} is "glissade":
set {_nom} to "&dGlissade"
else if {_s} is "glissadefeu":
set {_nom} to "&cGlissade de Feu"
else if {_s} is "meteores":
set {_nom} to "&4Pluie de Meteorites"
else:
set {_nom} to "&7Aucun"
if {cd::%uuid of loop-player%} is set:
if difference between {cd::%uuid of loop-player%} and now < 15 seconds:
set {_reste} to 15 - (difference between {cd::%uuid of loop-player%} and now / 1 second)
send action bar "&c⏳ %{_nom}% &8| &cRecharge : &e%{_reste}%s" to loop-player
stop
send action bar "&a✔ %{_nom}% &8| &7Pret !" to loop-player
# ============================================
# BOULE DE FEU - clic gauche sur mob
# ============================================
on damage of a living entity:
if attacker is a player:
if {classe::%uuid of attacker%} is "guerrier":
if {sort::%uuid of attacker%} is "boulefeu":
if {cd::%uuid of attacker%} is set:
if difference between {cd::%uuid of attacker%} and now < 15 seconds:
stop
set {cd::%uuid of attacker%} to now
damage victim by 8
set victim on fire for 3 seconds
send "&6Boule de Feu !" to attacker
else if {sort::%uuid of attacker%} is "bouclier":
if {cd::%uuid of attacker%} is set:
if difference between {cd::%uuid of attacker%} and now < 15 seconds:
stop
set {cd::%uuid of attacker%} to now
apply strength 1 to attacker for 5 seconds
apply resistance 1 to attacker for 5 seconds
send "&bBouclier ! Force + Resistance 5s" to attacker
# ============================================
# GLISSADE / GLISSADE FEU / METEORES - clic droit
# ============================================
on right click:
if {classe::%uuid of player%} is "guerrier":
set {_s} to {sort::%uuid of player%}
if {_s} is "glissade" or {_s} is "glissadefeu" or {_s} is "meteores":
set {_t} to type of player's tool
if {_t} is wooden sword or stone sword or iron sword or golden sword or diamond sword or netherite sword:
cancel event
if {cd::%uuid of player%} is set:
if difference between {cd::%uuid of player%} and now < 15 seconds:
stop
set {cd::%uuid of player%} to now
if {_s} is "glissade":
set player's velocity to vector(sin(player's yaw) * -2, 0.3, cos(player's yaw) * -2)
send "&dGlissade !" to player
else if {_s} is "glissadefeu":
set player's velocity to vector(sin(player's yaw) * -2, 0.3, cos(player's yaw) * -2)
loop all entities in radius 4 around player:
if loop-entity is not player:
ignite loop-entity for 3 seconds
damage loop-entity by 4
send "&cGlissade de Feu !" to player
else if {_s} is "meteores":
send "&4Pluie de Meteorites !" to player
loop 6 times:
wait 5 ticks
set {_x} to x-coordinate of player's location + (random integer between -5 and 5)
set {_z} to z-coordinate of player's location + (random integer between -5 and 5)
strike lightning at location({_x}, y-coordinate of player's location, {_z}, player's world)
on right click on block:
if {classe::%uuid of player%} is "guerrier":
set {_s} to {sort::%uuid of player%}
if {_s} is "glissade" or {_s} is "glissadefeu" or {_s} is "meteores":
set {_t} to type of player's tool
if {_t} is wooden sword or stone sword or iron sword or golden sword or diamond sword or netherite sword:
cancel event
if {cd::%uuid of player%} is set:
if difference between {cd::%uuid of player%} and now < 15 seconds:
stop
set {cd::%uuid of player%} to now
if {_s} is "glissade":
set player's velocity to vector(sin(player's yaw) * -2, 0.3, cos(player's yaw) * -2)
send "&dGlissade !" to player
else if {_s} is "glissadefeu":
set player's velocity to vector(sin(player's yaw) * -2, 0.3, cos(player's yaw) * -2)
loop all entities in radius 4 around player:
if loop-entity is not player:
ignite loop-entity for 3 seconds
damage loop-entity by 4
send "&cGlissade de Feu !" to player
else if {_s} is "meteores":
send "&4Pluie de Meteorites !" to player
loop 6 times:
wait 5 ticks
set {_x} to x-coordinate of player's location + (random integer between -5 and 5)
set {_z} to z-coordinate of player's location + (random integer between -5 and 5)
strike lightning at location({_x}, y-coordinate of player's location, {_z}, player's world)
Voici ton système complet intégré avec ton code existant :
Structure finale :
plugins/
├── DeluxeMenus/menus/
│ ├── class.yml ← menu de sélection de classe (/class)
│ └── sorts.yml ← menu des sorts (/sorts)
└── Skript/scripts/
└── class.sk ← toute la logique
Ce qui a changé :
Avant | Maintenant |
|---|---|
/classe guerrier pour rejoindre | /class → menu GUI |
Commande directe | DeluxeMenus appelle /choisirclasse <classe> |
1 seule classe | 5 classes dans le menu (Guerrier, Mage, Archer, Assassin, Paladin) |
Ton code guerrier intact | ✅ Intégré tel quel |
Tu peux maintenant ajouter les sorts des autres classes (Mage, Archer, etc.) dans class.sk de la même façon que le Guerrier. Tu veux que je les code ?
FAIT moi un systéme d passe de comba=t avec des iteml est de largent
package com.kodari.classsystem;
import com.kodari.classsystem.command.ClassCommand;
import com.kodari.classsystem.listener.ClassListener;
import com.kodari.classsystem.manager.ClassManager;
import org.bukkit.plugin.java.JavaPlugin;
public class ClassSystem extends JavaPlugin {
private ClassManager classManager;
@Override
public void onEnable() {
saveDefaultConfig();
classManager = new ClassManager(this);
classManager.load();
getCommand("class").setExecutor(new ClassCommand(this));
ClassListener listener = new ClassListener(this);
getServer().getPluginManager().registerEvents(listener, this);
listener.startPassiveTask();
getLogger().info("ClassSystem activé !");
}
@Override
public void onDisable() {
if (classManager != null) classManager.save();
getLogger().info("ClassSystem désactivé.");
}
public ClassManager getClassManager() {
return classManager;
}
public String prefix() {
return getConfig().getString("prefix", "&8[&6Classes&8] ")
.replace("&", "\u00a7");
}
}