Créer une armure
-
ton wather breating c’est ca
if(this.armorType == 0 && player.isInWater()) { player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 220, 0)); }
-
Bonjour, j’ai débuté le codage pour mon mod, j’ai bien suivi tout les tutos, j’ai compris sans trop de problème mais mon mod, comprend deux armures supplémentaire par rapport au vanilla, pour le layer, comment faire pour avoir deux sets d’armure complet ?
-
Tu veux faire 2 sets d’armures?Tu refais la meme chose que pour la premiere!
-
J’ai réussis à créer le deuxième set, mais les layers sont les mêmes quand je lance Minecraft
-
Tu vois la partie texture? Tu change la dessus tu cree une autre texture avec la meme pos et le meme nom et c’est fini(ps je suis sur mobile)
-
J’ai un problème j’ai dev une armure et elle veut pas etre afficher en jeu : https://pastebin.com/MLXZfBLa et https://pastebin.com/43W6fnpL
-
Les différentes
getIsRepairable2
3 et 4 ne servent à rien.
Il faut regrouper les if danspublic boolean getIsRepairable(ItemStack input, ItemStack repair)
.Tu peux également détailler le problème ? Ne s’affiche pas en jeu = les armures ne sont pas présentes du tout ou il n’y a pas de texture quand tu les portes ?
-
Les armures ne sont pas du tout en jeu
-
@Gollum1er Et regrouper comme ça ?
public boolean getIsRepairable(ItemStack input, ItemStack repair) { if(repair.getItem() == DragoniaMod.leggingsDarkFire || repair.getItem() == DragoniaMod.bootsDarkFire || repair.getItem() == DragoniaMod.chestPlateDarkFire|| repair.getItem() == DragoniaMod.helmetDarkFire || repair.getItem() == DragoniaMod.itemDarkFireIngot) { return true; } return false; }
-
Tes items ne sont jamais enregistrés, d’où le problème.
Et non plutôt comme ça :
public boolean getIsRepairable(ItemStack input, ItemStack repair) { if(repair.getItem() == DragoniaMod.bootsDarkFire || repair.getItem() == DragoniaMod.itemDarkFireIngot) { return true; } if(repair.getItem() == DragoniaMod.helmetDarkFire || repair.getItem() == DragoniaMod.itemDarkFireIngot) { return true; } // etc... return false; }
ou alors :
public boolean getIsRepairable(ItemStack input, ItemStack repair) { return repair.getItem() == DragoniaMod.bootsDarkFire && (repair.getItem() == DragoniaMod.itemDarkFireIngot || repair.getItem() == DragoniaMod.itemDarkFireIngot /* || ... */); }
-
@robin4002 Mais j’ai fait comme dans le tuto pour les ernregistrer
-
Je ne vois pas où ils sont enregistrés dans ton code.
-
J’ai oublié le GameRegistry !! C’est pas noté dans le tuto .
-
Si si, il faut lire …
@robin4002 a dit dans Créer une armure :
Vous devez également enregistrer ces items (voir pré-requis, créer un item basique).
-
Oups je l’ai relu 3 fois quand même en passant dessus sans voir ^^’ !
Merci beaucoup !! -
L’effet force n’existe pas dans la classe potion ?
-
J’ai rajouté toutes mes armures et ca donne ca magnifique crash report
---- Minecraft Crash Report ---- // I bet Cylons wouldn't have this problem. Time: 13/07/19 00:48 Description: Initializing game java.lang.IllegalArgumentException: The object fr.dragoniamod.dragonia.common.armors.ItemDarkFireArmor@49251807{49251807} has been registered twice, using the names dragoniamod:item_helmetdarkfire and dragoniamod:item_helmetfiregem. (Other object at this id is fr.dragoniamod.dragonia.common.armors.ItemDarkFireArmor@49251807{49251807}) at cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:416) at cpw.mods.fml.common.registry.GameData.registerItem(GameData.java:849) at cpw.mods.fml.common.registry.GameData.registerItem(GameData.java:812) at cpw.mods.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:149) at cpw.mods.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:137) at fr.dragoniamod.dragonia.common.DragoniaMod.preInit(DragoniaMod.java:151) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) at net.minecraft.client.Minecraft.run(Minecraft.java:942) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:416) at cpw.mods.fml.common.registry.GameData.registerItem(GameData.java:849) at cpw.mods.fml.common.registry.GameData.registerItem(GameData.java:812) at cpw.mods.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:149) at cpw.mods.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:137) at fr.dragoniamod.dragonia.common.DragoniaMod.preInit(DragoniaMod.java:151) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:942) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_191, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 838202152 bytes (799 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UCH Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) UCE dragoniamod{1.0.0} [Dragonia Mod] (bin) GL info: ' Vendor: 'Intel' Version: '4.5.0 - Build 23.20.16.4973' Renderer: 'Intel(R) HD Graphics 520' Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: Intel(R) HD Graphics 520 GL version 4.5.0 - Build 23.20.16.4973, Intel GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
Et voici mes classes : https://pastebin.com/xRrnKgcq https://pastebin.com/40tKsgRv https://pastebin.com/5H2TM3SN https://pastebin.com/huWc7zh7 https://pastebin.com/Cn2wUUc9 https://pastebin.com/r01UUSvx https://pastebin.com/FCEHZBvp
-
@Gollum1er a dit dans Créer une armure :
java.lang.IllegalArgumentException: The object fr.dragoniamod.dragonia.common.armors.ItemDarkFireArmor@49251807{49251807} has been registered twice, using the names dragoniamod:item_helmetdarkfire and dragoniamod:item_helmetfiregem. (Other object at this id is fr.dragoniamod.dragonia.common.armors.ItemDarkFireArmor@49251807{49251807})
Il faut lire les messages d’erreurs, ils sont assez explicites. Tu as enregistré deux fois le même item avec des noms différents.
-
BON, Faut que je m’achète des lunettes car je l’ai lu le crash report x) Merci !
-
Bonsoir
je n’arrive pas a comprendre pouquoi le getIsRepairable et ItemStack reste en rouge si tu as une idée je dis pas non.)