Eluune Posté(e) le 15 novembre 2016 Posté(e) le 15 novembre 2016 Bonjour les amis ! Je commence tout juste la mise en place d'un jeu de carte style Hearthstone sur minecraft et j'aimerai le faire fonctionner directement dans un Menu Interactif (Menu GUI). Voici mon bout de code : command /listcarte: trigger: set {item.carte.list::*} to empty wait 3 ticks add spawn egg:50 named "&4Creeeeeeper !" with lore "&6Description :||&7- &9ATQ : &86 &7- &cVie : &82||&7- &5Cout : &82 &7- &2Type : &8Cac||&eExplose au contact||&dCraint l'eau||" to {item.carte.list::*} add spawn egg:51 named "&bArcher squelette" with lore "&6Description :||&7- &9ATQ : &82 &7- &cVie : &83||&7- &5Cout : &81 &7- &2Type : &8Dist||&dCraint le jour||" to {item.carte.list::*} add spawn egg:52 named "&bAraignee" with lore "&6Description :||&7- &9ATQ : &82 &7- &cVie : &83||&7- &5Cout : &82 &7- &2Type : &8Cac||&eTerrain : &8toile||" to {item.carte.list::*} add spawn egg:54 named "&bZombie" with lore "&6Description :||&7- &9ATQ : &83 &7- &cVie : &83||&7- &5Cout : &82 &7- &2Type : &8Cac||&dCraint le jour||" to {item.carte.list::*} add spawn egg:55 named "&bSlime" with lore "&6Description :||&7- &9ATQ : &82 &7- &cVie : &83||&7- &5Cout : &81 &7- &2Type : &8Cac||&einvoque un slime 2/1 a la mort||&dCraint l'eau" to {item.carte.list::*} add spawn egg:56 named "&bGhast" with lore "&6Description :||&7- &9ATQ : &84 &7- &cVie : &83||&7- &5Cout : &82 &7- &2Type : &8Dist||" to {item.carte.list::*} add spawn egg:57 named "&bZombie Pigman" with lore "&6Description :||&7- &9ATQ : &83 &7- &cVie : &84||&7- Cout : &82 &7- &2Type : &8Cac||&eTous les Pigman attaquent la cible" to {item.carte.list::*} add spawn egg:58 named "&bEnderman" with lore "&6Description :||&7- &9ATQ : &85 &7- &cVie : &84||&7- &5Cout : &83 &7- &2Type : &8Cac||&eAttaque aleatoirement||&dCraint la pluie" to {item.carte.list::*} add spawn egg:59 named "&bAraignee des caves" with lore "&6Description :||&7- &9ATQ : &82 &7- &cVie : &82||&7- &5Cout : &82 &7- &2Type : &8Cac||&eInflige poison (2 tours)||" to {item.carte.list::*} add spawn egg:60 named "&bSilverfish" with lore "&6Description :||&7- &9ATQ : &81 &7- &cVie : &82||&7- &5Cout : &82 &7- &2Type : &8Cac||&eNe peut être attaque au Cac||&e25%% de chance d'esquiver||" to {item.carte.list::*} add spawn egg:61 named "&bBlaze" with lore "&6Description :||&7- &9ATQ : &81 &7- &cVie : &83||&7- &5Cout : &83 &7- &2Type : &8Dist||&eEnflame trois cibles(35%% raté)||&dCraint l'eau||" to {item.carte.list::*} add spawn egg:62 named "&bMagma Cube" with lore "&6Description :||&7- &9ATQ : &81 &7- &cVie : &85||&7- &5Cout : &82 &7- &2Type : &8Cac||&eExplose à la mort||&dCraint l'eau||" to {item.carte.list::*} add spawn egg:65 named "&bChauve-souris" with lore "&6Description :||&7- &9ATQ : &80 &7- &cVie : &84||&7- &5Cout : &81 &7- &2Type : &8Cac||&e80%% d'esquive||" to {item.carte.list::*} add spawn egg:66 named "&bWitch" with lore "&6Description :||&7- &9ATQ : &82 &7- &cVie : &83||&7- &5Cout : &83 &7- &2Type : &8Dist||&eAleatoirement Soigne ou Inflige des degats||" to {item.carte.list::*} add spawn egg:67 named "&bEndermite" with lore "&6Description :||&7- &9ATQ : &82 &7- &cVie : &82||&7- &5Cout : &82 &7- &2Type : &8Cac||" to {item.carte.list::*} add spawn egg:68 named "&bGuardien" with lore "&6Description :||&7- &9ATQ : &83 &7- &cVie : &85||&7- &5Cout : &84 &7- &2Type : &8Dist||&dCraint les eclairs||" to {item.carte.list::*} command /deck: trigger: open chest with 1 rows named "RoyalDeck" to player wait 3 ticks format slot 2 of player with crafting table named "Créer son deck" with lore "" to run [make console execute command "/creerdeck %player%"] format slot 4 of player with anvil named "Modifier son deck" with lore "" to run [make console execute command "/modifdeck %player%"] format slot 6 of player with paper named "Regarder ses cartes" with lore "" to run [make console execute command "/checkcarte %player%"] command /creerdeck <player>: trigger: open chest with 6 rows named "Crée ton Deck" to player wait 3 ticks set {_slot} to 0 command /duel: trigger: open chest with 6 rows named "Joueurs" to player wait 3 ticks set {_slot} to 0 loop all players: set {_head} to "%loop-player%" parsed as offline player format slot {_slot} of player with skull of {_head} named "&6%{_head}%" with lore "" to run [make console execute command "/carte %player% %{_head}%"] wait 3 ticks add 1 to {_slot} command /carte <player> <player>: trigger: message "&6[Duel] : &7Vous venez d'envoyer une demande de duel de cartes à %arg 2% !" to arg 1 message "&6[Duel] : &7%arg 1% vous demande en duel. &c/accept %arg 1% &7pour accepter le duel" to arg 2 set {demande.%arg 1%} to "attente" set {reponse.%arg 2%} to "attente" wait 30 seconds if {demande.%arg 1%} is "accept": stop if {demande.%arg 1%} is "attente": set {demande.%arg 1%} to "refus" set {reponse.%arg 2%} to "refus" message "&6[Duel] : &7Demande de duel refusé ou délai dépassé !" to arg 1 command /accept <player>: trigger: if {demande.%arg 1%} is "attente": if {reponse.%player%} is "attente": set {demande.%arg 1%} to "accept" set {reponse.%player%} to "accept" make console execute command "/initialisation %player% %arg 1%" command /initialisation <player> <player>: trigger: set {terrain.%arg 1%.%arg 2%} to "plaine" set {vie.%arg 1%} to 20 set {vie.%arg 2%} to 20 set {attaque.%arg 1%} to 5 set {attaque.%arg 2%} to 5 set {defense.%arg 1%} to 5 set {defense.%arg 2%} to 5 set {use.%arg 1%} to 0 set {use.%arg 2%} to 0 make console execute command "/tour %arg 1% %arg 2%" make console execute command "/tour %arg 2% %arg 1%" command /placement <player> <item> <integer>: trigger: if {use.%arg 1%} is 3: format slot 34 of arg 1 with arg 2 to run [make console execute command ""] format slot arg 3 of arg 1 with gray stained glass pane named " " with lore "" to run [make console execute command ""] if {use.%arg 1%} is 2: format slot 32 of arg 1 with arg 2 to run [make console execute command ""] format slot arg 3 of arg 1 with gray stained glass pane named " " with lore "" to run [make console execute command ""] add +1 to {use.%arg 1%} if {use.%arg 1%} is 1: format slot 30 of arg 1 with arg 2 to run [make console execute command ""] format slot arg 3 of arg 1 with gray stained glass pane named " " with lore "" to run [make console execute command ""] add +1 to {use.%arg 1%} if {use.%arg 1%} is 0: format slot 28 of arg 1 with arg 2 to run [make console execute command ""] format slot arg 3 of arg 1 with gray stained glass pane named " " with lore "" to run [make console execute command ""] add +1 to {use.%arg 1%} wait 1 second command /tour <player> <player>: trigger: open chest with 6 rows named "Choisissez 4 cartes" to arg 1 wait 3 ticks # Pioche de cartes set {_slot} to 46 while {_slot} isn't 53: set {randomitem} to random element out of {item.carte.list::*} add a random item out of {randomitem} to the player if {_slot} is 46: set {slot1.%arg 1%} to {randomitem} if {_slot} is 47: set {slot2.%arg 1%} to {randomitem} if {_slot} is 48: set {slot3.%arg 1%} to {randomitem} if {_slot} is 49: set {slot4.%arg 1%} to {randomitem} if {_slot} is 50: set {slot5.%arg 1%} to {randomitem} if {_slot} is 51: set {slot6.%arg 1%} to {randomitem} if {_slot} is 52: set {slot7.%arg 1%} to {randomitem} set {slot} to {_slot} format slot {_slot} of arg 1 with {randomitem} to run [make console execute command "/placement %arg 1% %{randomitem}% %{slot}%"] wait 3 tick add 1 to {_slot} # Ne change jamais format slot 0 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 1 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 2 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 3 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 4 of arg 1 with skull of arg 2 named "&4%arg 2%" with lore "&5Vie : &6%{vie.%arg 2%}%||&5Attaque : &6%{attaque.%arg 2%}%||&5Armure : &6%{armure.%arg 2%}%" to run [make console execute command ""] format slot 5 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 6 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 7 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 8 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 36 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 37 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 38 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 39 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 40 of arg 1 with skull of arg 1 named "&3%arg 1%" with lore "&5Vie : &6%{vie.%arg 1%}%||&5Attaque : &6%{attaque.%arg 1%}%||&5Armure : &6%{armure.%arg 1%}%" to run [make console execute command ""] format slot 41 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 42 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 43 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 44 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 9 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 11 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 13 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 15 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 17 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 27 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 29 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 31 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 33 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] format slot 35 of arg 1 with black stained glass pane named " " with lore "" to run [make console execute command ""] # Terrain if {terrain.%arg 1%.%arg 2%} is "plaine": format slot 18 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] format slot 19 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] format slot 20 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] format slot 21 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] format slot 22 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] format slot 23 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] format slot 24 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] format slot 25 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] format slot 26 of arg 1 with green stained glass pane named "&2Plaine" with lore "&6Description :||&7Aucune incidence sur le jeu" to run [make console execute command ""] if {terrain.%arg 1%.%arg 2%} is "lave": format slot 18 of arg 1 with red stained glass pane named "&4Lave" with lore "&6Description :||&7brule les attaquant au cac (2T)" to run [make console execute command ""] format slot 19 of arg 1 with red stained glass pane named "&4Lave" with lore "&6Description :||&7brule les attaquant au cac (2T)" to run [make console execute command ""] format slot 20 of arg 1 with red stained glass pane named "&4Lave" with lore "&6Description :||&7brule les attaquant au cac (2T)" to run [make console execute command ""] format slot 21 of arg 1 with red stained glass pane named "&4Lave" with lore "&6Description :||&7brule les attaquant au cac (2T)" to run [make console execute command ""] format slot 22 of arg 1 with red stained glass pane named "&4Lave" with lore "&6Description :||&7brule les attaquant au cac (2T)" to run [make console execute command ""] format slot 23 of arg 1 with red stained glass pane named "&4Lave" with lore "&6Description :||&7brule les attaquant au cac (2T)" to run [make console execute command ""] format slot 24 of arg 1 with red stained glass pane named "&4Lave" with lore "&6Description :||&7brule les attaquant au cac (2T)" to run [make console execute command ""] format slot 25 of arg 1 with red stained glass pane named "&4Lave" with lore "&6Description :||&7brule les attaquant au cac (2T)" to run [make console execute command ""] Le problème auquel je me heurte, c'est que tout fonctionne jusqu'à l'utilisation de la première carte, mais la deuxième n'a aucun effet et n'actualise pas le Menu... Quelqu'un aurait-il une solution à mon problème ? J'ai bien pensé qu'il pourrait être nécessaire de fermer le menu pour le réouvrir, mais sans succès ici aussi.
remy29 Posté(e) le 16 novembre 2016 Posté(e) le 16 novembre 2016 Je regarde ça, je te signalerai si je trouve!
Black_Eyes Posté(e) le 19 novembre 2016 Posté(e) le 19 novembre 2016 Ca existe oui, voici un petit morceau d'un plugin que j'ai créé qui utilise un menu interactif: on rightclick on a beacon: cancel event open chest with 3 rows named "King menu" to player wait 3 ticks format slot 0 of player with 296 named "ressource points" to close then run [make player execute command "/menu2"] format slot 1 of player with boat named "Max members" with lore "Current max number: %{kingdoms::%{kingdom.%player%}%::maxmembers}% ||Cost: {@Member price in ressource points} ressource points" to run [make player execute command "/maxmember"] format slot 8 of player with 35:14 named "Mass war statut" to close format slot 9 of player with iron chestplate named "Damage reduction" to close format slot 10 of player with red flower named "Regeneration boost" to close format slot 11 of player with iron sword named "Damage boost" to close format slot 12 of player with arrow named "Arrow damage" to close format slot 13 of player with end portal frame named "Increase kingdom chest size" to close format slot 14 of player with beacon named "Structure shop" to close format slot 15 of player with 35:11 named "Permissions" to close then run [make player execute command "/menu3"] format slot 17 of player with hay block named "Ressource points: %{kingdoms::%{kingdom.%player%}%::points}%" to close format slot 18 of player with blaze rod named "Champion upgrades" to close format slot 19 of player with 383 named "Extra upgrades" to close format slot 20 of player with dispenser named "Turrets shop" to close format slot 26 of player with chest named "Nexus chest" to close then run [make player execute command "/menu4"]
Rémi Posté(e) le 27 novembre 2016 Posté(e) le 27 novembre 2016 Salut, N'oublie pas de mettre ton sujet en résolu pour éviter au développeur d'aller voir alors que tu n'a pas besoin. Merci :3 Cdt,
Eluune Posté(e) le 27 novembre 2016 Auteur Posté(e) le 27 novembre 2016 Mon problème n'est pas résolu... d'où mon obstination à laisser ce topic ouvert Les GUI fonctionnent bien. Le problème vient de l'execution d'une commande au sein meme du GUI destiné à modifier ce dernier. ca fonctionne la première fois, mais jamais la seconde !
remy29 Posté(e) le 27 novembre 2016 Posté(e) le 27 novembre 2016 C'est tout à fait normal. Mais voici deux solutions: - Tu utilises l'event on inventory click - Encore plus simple, tu rouvre le menu quand on clique. 1
Messages recommandés