MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Commande pour modifier l'item qui est dans la Main

    Planifier Épinglé Verrouillé Déplacé Non résolu Sans suite
    1.12.2
    20 Messages 4 Publieurs 1.5k Vues 2 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • En0ri4nE Hors-ligne
      En0ri4n
      dernière édition par

      oui mince j’avais pas vu merci !
      mais dans le chargement d’un monde j’ai ça :

      [19:29:22] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded.
      

      Le java c'est comme une boîte de chocolat, on sait jamais sur quoi on va tomber !

      1 réponse Dernière réponse Répondre Citer 0
      • robin4002R Hors-ligne
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
        dernière édition par

        Il faudrait les logs complets pour savoir quel est le problème.

        1 réponse Dernière réponse Répondre Citer 0
        • En0ri4nE Hors-ligne
          En0ri4n
          dernière édition par

          voila les logs complets :

          2018-12-19 19:28:23,124 main ERROR Unable to move file C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\latest.log to C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\2018-12-19-6.log: java.nio.file.FileSystemException C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\latest.log -> C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\2018-12-19-6.log: Le processus ne peut pas accéder au fichier car ce fichier est utilisé par un autre processus.
          
          2018-12-19 19:28:23,131 main ERROR Unable to delete file C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\latest.log: java.nio.file.FileSystemException C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\latest.log: Le processus ne peut pas accéder au fichier car ce fichier est utilisé par un autre processus.
          
          2018-12-19 19:28:23,154 main ERROR Unable to move file C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\debug.log to C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\debug-1.log: java.nio.file.FileSystemException C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\debug.log -> C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\debug-1.log: Le processus ne peut pas accéder au fichier car ce fichier est utilisé par un autre processus.
          
          2018-12-19 19:28:23,161 main ERROR Unable to delete file C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\debug.log: java.nio.file.FileSystemException C:\Users\*\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\logs\debug.log: Le processus ne peut pas accéder au fichier car ce fichier est utilisé par un autre processus.
          
          [19:28:23] [main/INFO] [GradleStart]: Extra: []
          [19:28:23] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Rajo/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
          [19:28:23] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
          [19:28:23] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
          [19:28:23] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
          [19:28:23] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
          [19:28:23] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2768 for Minecraft 1.12.2 loading
          [19:28:23] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre1.8.0_181
          [19:28:23] [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory.
          [19:28:23] [main/ERROR] [FML]: Full: C:\Users\Rajo\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar
          [19:28:23] [main/ERROR] [FML]: Trimmed: c:/users/rajo/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/
          [19:28:23] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
          [19:28:23] [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs.
          2018-12-19 19:28:25,451 main WARN Disabling terminal, you're running in an unsupported environment.
          [19:28:25] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
          [19:28:25] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
          [19:28:25] [main/INFO] [FML]: Searching C:\Users\Rajo\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\.\mods for mods
          [19:28:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
          [19:28:25] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
          [19:28:25] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
          [19:28:25] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
          [19:28:25] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
          [19:28:25] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
          [19:28:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
          [19:28:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
          [19:28:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
          [19:28:29] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
          [19:28:29] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
          [19:28:29] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
          [19:28:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
          [19:28:30] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
          [19:28:30] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
          [19:28:30] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
          [19:28:31] [main/INFO] [minecraft/Minecraft]: Setting user: Player645
          [19:28:37] [main/INFO] [minecraft/Minecraft]: LWJGL Version: 2.9.4
          [19:28:38] [main/INFO] [FML]: -- System Details --
          Details:
          	Minecraft Version: 1.12.2
          	Operating System: Windows 7 (amd64) version 6.1
          	Java Version: 1.8.0_181, Oracle Corporation
          	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
          	Memory: 787851288 bytes (751 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
          	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
          	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
          	FML: 
          	Loaded coremods (and transformers): 
          	GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.4229' Renderer: 'Intel(R) HD Graphics 3000'
          [19:28:38] [main/INFO] [FML]: MinecraftForge v14.23.5.2768 Initialized
          [19:28:38] [main/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
          [19:28:39] [main/INFO] [FML]: Replaced 1036 ore ingredients
          [19:28:39] [main/INFO] [FML]: Searching C:\Users\Rajo\Desktop\Eno\Dev\Forge-Directory 1.12.2\run\.\mods for mods
          [19:28:41] [Thread-3/INFO] [FML]: Using sync timing. 200 frames of Display.update took 280912271 nanos
          [19:28:42] [main/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
          [19:28:42] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, mapmakercommands] at CLIENT
          [19:28:42] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, mapmakercommands] at SERVER
          [19:28:43] [main/INFO] [minecraft/SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Map Maker Commands +
          [19:28:43] [main/INFO] [FML]: Processing ObjectHolder annotations
          [19:28:43] [main/INFO] [FML]: Found 1168 ObjectHolder annotations
          [19:28:43] [main/INFO] [FML]: Identifying ItemStackHolder annotations
          [19:28:43] [main/INFO] [FML]: Found 0 ItemStackHolder annotations
          [19:28:43] [main/INFO] [FML]: Configured a dormant chunk cache size of 0
          [19:28:43] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
          [19:28:43] [main/INFO] [FML]: Applying holder lookups
          [19:28:43] [main/INFO] [FML]: Holder lookups applied
          [19:28:43] [main/INFO] [FML]: Applying holder lookups
          [19:28:43] [main/INFO] [FML]: Holder lookups applied
          [19:28:43] [main/INFO] [FML]: Applying holder lookups
          [19:28:43] [main/INFO] [FML]: Holder lookups applied
          [19:28:43] [main/INFO] [FML]: Applying holder lookups
          [19:28:43] [main/INFO] [FML]: Holder lookups applied
          [19:28:43] [main/INFO] [FML]: Injecting itemstacks
          [19:28:43] [main/INFO] [FML]: Itemstack injection complete
          [19:28:44] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: UP_TO_DATE Target: null
          [19:28:51] [Sound Library Loader/INFO] [minecraft/SoundManager]: Starting up SoundSystem...
          [19:28:52] [Thread-5/INFO] [minecraft/SoundManager]: Initializing LWJGL OpenAL
          [19:28:52] [Thread-5/INFO] [minecraft/SoundManager]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
          [19:28:52] [Thread-5/INFO] [minecraft/SoundManager]: OpenAL initialized.
          [19:28:52] [Sound Library Loader/INFO] [minecraft/SoundManager]: Sound engine started
          [19:29:05] [main/INFO] [FML]: Max texture size: 8192
          [19:29:05] [main/INFO] [minecraft/TextureMap]: Created: 512x512 textures-atlas
          [19:29:10] [main/INFO] [FML]: Applying holder lookups
          [19:29:10] [main/INFO] [FML]: Holder lookups applied
          [19:29:10] [main/INFO] [FML]: Injecting itemstacks
          [19:29:10] [main/INFO] [FML]: Itemstack injection complete
          [19:29:10] [main/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods
          [19:29:10] [main/INFO] [mojang/NarratorWindows]: Narrator library for x64 successfully loaded
          [19:29:12] [Realms Notification Availability checker #1/INFO] [mojang/RealmsClient]: Could not authorize you against Realms server: Invalid session id
          [19:29:14] [Server thread/INFO] [minecraft/IntegratedServer]: Starting integrated minecraft server version 1.12.2
          [19:29:14] [Server thread/INFO] [minecraft/IntegratedServer]: Generating keypair
          [19:29:14] [Server thread/INFO] [FML]: Injecting existing registry data into this server instance
          [19:29:15] [Server thread/INFO] [FML]: Applying holder lookups
          [19:29:15] [Server thread/INFO] [FML]: Holder lookups applied
          [19:29:15] [Server thread/INFO] [FML]: Loading dimension 0 (Yes) (net.minecraft.server.integrated.IntegratedServer@34548260)
          [19:29:17] [Server thread/INFO] [minecraft/AdvancementList]: Loaded 488 advancements
          [19:29:17] [Server thread/INFO] [FML]: Loading dimension -1 (Yes) (net.minecraft.server.integrated.IntegratedServer@34548260)
          [19:29:17] [Server thread/INFO] [FML]: Loading dimension 1 (Yes) (net.minecraft.server.integrated.IntegratedServer@34548260)
          [19:29:17] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for level 0
          [19:29:18] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 0%
          [19:29:19] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 25%
          [19:29:20] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing spawn area: 72%
          [19:29:20] [Server thread/ERROR] [FML]: A fatal exception occurred during the server starting event
          net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Map Maker Commands + (mapmakercommands)
          
          Caused by: java.lang.NullPointerException
          	at net.minecraft.command.CommandHandler.registerCommand(CommandHandler.java:162) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
          	at net.minecraftforge.fml.common.event.FMLServerStartingEvent.registerServerCommand(FMLServerStartingEvent.java:59) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
          	at fr.eno.mmc.MapMakerCommandsBase.serverStarting(MapMakerCommandsBase.java:59) ~[bin/:?]
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
          	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
          	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
          	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:626) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
          	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
          	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
          	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
          	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
          	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
          	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
          	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
          	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
          	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
          	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
          	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
          	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) ~[LoadController.class:?]
          	at net.minecraftforge.fml.common.Loader.serverStarting(Loader.java:794) [Loader.class:?]
          	at net.minecraftforge.fml.common.FMLCommonHandler.handleServerStarting(FMLCommonHandler.java:297) [FMLCommonHandler.class:?]
          	at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:162) [IntegratedServer.class:?]
          	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:552) [MinecraftServer.class:?]
          	at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
          [19:29:21] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server
          [19:29:21] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players
          [19:29:21] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds
          [19:29:21] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'Yes'/overworld
          [19:29:21] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'Yes'/the_nether
          [19:29:21] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'Yes'/the_end
          [19:29:21] [Server thread/INFO] [FML]: Unloading dimension 0
          [19:29:21] [Server thread/INFO] [FML]: Unloading dimension -1
          [19:29:21] [Server thread/INFO] [FML]: Unloading dimension 1
          [19:29:22] [Server thread/INFO] [FML]: Applying holder lookups
          [19:29:22] [Server thread/INFO] [FML]: Holder lookups applied
          [19:29:22] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded.
          [19:29:34] [main/INFO] [minecraft/Minecraft]: Stopping!
          [19:29:34] [main/INFO] [minecraft/SoundManager]: SoundSystem shutting down...
          [19:29:35] [main/WARN] [minecraft/SoundManager]: Author: Paul Lamb, www.paulscode.com
          
          

          Le java c'est comme une boîte de chocolat, on sait jamais sur quoi on va tomber !

          1 réponse Dernière réponse Répondre Citer 0
          • robin4002R Hors-ligne
            robin4002 Moddeurs confirmés Rédacteurs Administrateurs
            dernière édition par

            Ta fonction getAliases renvoies null, ce qui cause un npe.
            Il faut renvoyer une liste valide.

            1 réponse Dernière réponse Répondre Citer 0
            • En0ri4nE Hors-ligne
              En0ri4n
              dernière édition par

              merci ça marche maintenant ! 😀
              Mais je n’arrive pas a trouver comment modifier le nom de l’item qui est dans la main,
              j’ai essayer ça mais ça ne marche pas :

              	public void execute(MinecraftServer server, ICommandSender sender, String[] strings) throws CommandException
              	{
              		if(sender instanceof EntityPlayer)
              		{
              			EntityPlayer player = (EntityPlayer) sender;
              			String name = player.getActiveHand().MAIN_HAND.name();
              			player.inventory.getDisplayName().equals(name);
              		}
              
              	}
              

              mais j’aimerais aussi pouvoir mettre le nom de couleur dans laquelle on veut le nom,
              par exemple : /rename NomDelItem Couleur EnGras(true ou false)
              Est ce que l’on peut le faire ?

              Le java c'est comme une boîte de chocolat, on sait jamais sur quoi on va tomber !

              1 réponse Dernière réponse Répondre Citer 0
              • robin4002R Hors-ligne
                robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                dernière édition par robin4002

                player.inventory.getDisplayName() retourne le nom de l’inventaire et .equals c’est une méthode qui permet de comparer deux objets.

                Donc là forcement oui, ton code ne va rien faire.

                Il faut plutôt quelque chose comme ceci :

                ItemStack stack = player.getHeldItem(EnumHand.MAIN_HAND); // obtient l'item dans la main principale
                stack.setStackDisplayName(displayName); // change le nom affiché
                

                Pour récupérer les arguments tapés, c’est ta variable strings qui les contient.
                strings[0] -> le premier argument (NomDelItem dans l’exemple que tu as donné)
                strings[1] -> le deuxièmeargument (Couleur dans l’exemple que tu as donné)
                etc…
                Et il faut bien sur vérifier que strings.length ait la bonne valeur avant d’utiliser le string à l’index voulu (sinon ça va déclencher une ArrayOutOfBoundException

                1 réponse Dernière réponse Répondre Citer 0
                • En0ri4nE Hors-ligne
                  En0ri4n
                  dernière édition par En0ri4n

                  yes merci ça marche ☺
                  mais je n’arrive pas a ajouter la couleur :

                  public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
                  	{
                  		if(sender instanceof EntityPlayer)
                  		{
                  			EntityPlayer player = (EntityPlayer) sender;
                  			ItemStack stack = player.getHeldItem(EnumHand.MAIN_HAND); // obtient l'item dans la main principale
                  			TextFormatting color = TextFormatting.valueOf(args[1]);
                  			TextFormatting effect = TextFormatting.valueOf(args[2]);
                  			stack.setStackDisplayName(args[0]); // change le nom affiché
                  
                  		}
                  
                  	}
                  

                  J’ai essayer avec le text formatting mais sans succès (ou alors je l’ai mal fait 😆)
                  une idée ?

                  Le java c'est comme une boîte de chocolat, on sait jamais sur quoi on va tomber !

                  1 réponse Dernière réponse Répondre Citer 0
                  • robin4002R Hors-ligne
                    robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                    dernière édition par robin4002

                    Le couleur tu veux que l’utilisateur l’écrit avec quel format ? §1 §2 etc. ? ou RED, BLUE, etc. ?

                    1 réponse Dernière réponse Répondre Citer 0
                    • En0ri4nE Hors-ligne
                      En0ri4n
                      dernière édition par En0ri4n

                      plutot en red, blue, bold,obfuscated
                      j’aurais voulu additionner comme ça :
                      /rename [NomDel’Item] blue bold underline

                      Le java c'est comme une boîte de chocolat, on sait jamais sur quoi on va tomber !

                      1 réponse Dernière réponse Répondre Citer 0
                      • robin4002R Hors-ligne
                        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                        dernière édition par

                        Pour ça va falloir faire une boucle qui pour chaque args vérifie s’il existe dans les EnumFormatting, et si oui retourner le texte de formatage qui va avec.

                        1 réponse Dernière réponse Répondre Citer 0
                        • En0ri4nE Hors-ligne
                          En0ri4n
                          dernière édition par

                          et je pourrais faire ça comment par exemple ?

                          Le java c'est comme une boîte de chocolat, on sait jamais sur quoi on va tomber !

                          1 réponse Dernière réponse Répondre Citer 0
                          • BrokenSwingB Hors-ligne
                            BrokenSwing Moddeurs confirmés Rédacteurs
                            dernière édition par

                            Salut, c’est une opération assez simple :

                            def : style
                            Pour i allant de 1 à (taille(args) - 1):
                                Si args[i] dans valeurs(EnumFormatting) :
                                     def : format = récupérerEnumFormattingDepuisNom(args[i])
                                     style.ajouterFormat(format)
                            

                            Voilà, plus qu’à traduire cette logique en Java.

                            1 réponse Dernière réponse Répondre Citer 1
                            • En0ri4nE Hors-ligne
                              En0ri4n
                              dernière édition par

                              le truc c’est que je suis en train d’apprendre le java et donc je comprends pas trop ou plutot je ne sais pas comment le traduire en java 😓
                              tu pourrais m’expliquer ?

                              Le java c'est comme une boîte de chocolat, on sait jamais sur quoi on va tomber !

                              1 réponse Dernière réponse Répondre Citer 0
                              • SpyManS Hors-ligne
                                SpyMan
                                dernière édition par SpyMan

                                yo sinon tu utilise comme dans tout les plugins le caractere & dans le message ensuite tu le remplace par un § et minecraft fait le formatage tout seul x)

                                player.getHeldItemMainhand().setStackDisplayName(name.replace('&', '§'));
                                

                                si tu comprends toujours pas comment faire passe sur le discord et je peux vocal pour plus d’explications x)

                                1 réponse Dernière réponse Répondre Citer 0
                                • 1 / 1
                                • Premier message
                                  Dernier message
                                Design by Woryk
                                ContactMentions Légales

                                MINECRAFT FORGE FRANCE © 2024

                                Powered by NodeBB