Non résolu Probleme mods 1.12.2
-
probleme avec mon mods
je vous donne l’erreur si vous pouvez m’aider dite moi tout---- Minecraft Crash Report ---- // Don't be sad, have a hug! <3 Time: 2/23/22 4:46 PM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from modsatomez (modsatomez) Caused by: java.lang.NullPointerException at fr.atomez.noz43.ModsatomezMod.preInit(ModsatomezMod.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:639) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) at net.minecraft.client.Minecraft.init(Minecraft.java:514) at net.minecraft.client.Minecraft.run(Minecraft.java:422) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25) A detailed walkthrough of the error, its code path and all known details is as follows: ---------------------------------------------------------------------------------------
-
Bonsoir,
Qu’est-ce qui a à la ligne 63 de ModsatomezMod.java ?
-
@robin4002 ```
@Mod.EventHandler public void serverLoad(FMLServerStartingEvent event) { elements.getElements().forEach(element -> element.serverLoad(event)); proxy.serverLoad(event); }
la ligne 63 dans le mods c la ligne 5 ici
-
L’accolade ? C’est pas pas possible, tu as un NPE à la ligne 63, il ne peut pas avoir un NPE sur une accolade.
-
@robin4002 quand je retire les deux accolade ça me fait une erreur
-
Je n’ai jamais dit d’enlever les accolades.
Ce que j’ai dis c’est que ce n’est pas possible que l’erreur soit sur la ligne où se trouve sur l’accolade.
Donc soit tu n’as pas donné la bonne ligne, soit tu as changé ton code entre le crash et le moment où tu as regardés les numéros de ligne. -
@robin4002 nn du tout
-
@robin4002 voila l’erreur mtn
---- Minecraft Crash Report ---- // Hey, that tickles! Hehehe! Time: 2/27/22 11:36 AM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from modsatomez (modsatomez) Caused by: java.lang.NullPointerException at fr.atomez.noz43.ModsatomezMod.preInit(ModsatomezMod.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:639) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) at net.minecraft.client.Minecraft.init(Minecraft.java:514) at net.minecraft.client.Minecraft.run(Minecraft.java:422) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25) A detailed walkthrough of the error, its code path and all known details is as follows: ---------------------------------------------------------------------------------------
est voila mon code
package fr.atomez.noz43; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.EntityEntry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraft.world.biome.Biome; import net.minecraft.potion.Potion; import net.minecraft.item.Item; import net.minecraft.block.Block; import java.util.function.Supplier; @Mod(modid = ModsatomezMod.MODID, version = ModsatomezMod.VERSION) public class ModsatomezMod { public static final String MODID = "modsatomez"; public static final String VERSION = "1.0.0"; public static final SimpleNetworkWrapper PACKET_HANDLER = NetworkRegistry.INSTANCE.newSimpleChannel("modsatomez:a"); public static IProxyModsatomezMod proxy; @Mod.Instance(MODID) public static ModsatomezMod instance; public ElementsModsatomezMod elements = new ElementsModsatomezMod(); @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); GameRegistry.registerWorldGenerator(elements, 5); GameRegistry.registerFuelHandler(elements); NetworkRegistry.INSTANCE.registerGuiHandler(this, new ElementsModsatomezMod.GuiHandler()); elements.preInit(event); MinecraftForge.EVENT_BUS.register(elements); elements.getElements().forEach(element -> element.preInit(event)); proxy.preInit(event); } @Mod.EventHandler public void init(FMLInitializationEvent event) { elements.getElements().forEach(element -> element.init(event)); proxy.init(event); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } @Mod.EventHandler public void serverLoad(FMLServerStartingEvent event) { elements.getElements().forEach(element -> element.serverLoad(event)); proxy.serverLoad(event); } @SubscribeEvent public void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(elements.getBlocks().stream().map(Supplier::get).toArray(Block[]::new)); } @SubscribeEvent public void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(elements.getItems().stream().map(Supplier::get).toArray(Item[]::new)); } @SubscribeEvent public void registerBiomes(RegistryEvent.Register<Biome> event) { event.getRegistry().registerAll(elements.getBiomes().stream().map(Supplier::get).toArray(Biome[]::new)); } @SubscribeEvent public void registerEntities(RegistryEvent.Register<EntityEntry> event) { event.getRegistry().registerAll(elements.getEntities().stream().map(Supplier::get).toArray(EntityEntry[]::new)); } @SubscribeEvent public void registerPotions(RegistryEvent.Register<Potion> event) { event.getRegistry().registerAll(elements.getPotions().stream().map(Supplier::get).toArray(Potion[]::new)); } @SubscribeEvent public void registerSounds(RegistryEvent.Register<net.minecraft.util.SoundEvent> event) { elements.registerSounds(event); } @SubscribeEvent @SideOnly(Side.CLIENT) public void registerModels(ModelRegistryEvent event) { elements.getElements().forEach(element -> element.registerModels(event)); } static { FluidRegistry.enableUniversalBucket(); } }
-
Ton code a clairement bougé depuis le premier rapport de crash, puis que maintenant le NPE est sur la ligne 46 :
Caused by: java.lang.NullPointerException
at fr.atomez.noz43.ModsatomezMod.preInit(ModsatomezMod.java:46)Le problème c’est que ta variable proxy n’est jamais initialisé, donc forcement la ligne
proxy.preInit(event);
cause un NPE. -
@robin4002 donc quesque je peux faire pour ça
-
Ajouter l’annotation SidedProxy qui te manque au dessus de ta déclaration de variable proxy.
Voir le tutoriel ici : https://www.minecraftforgefrance.fr/topic/2906/créer-la-base-de-son-mod#la-classe-client -
@robin4002 meci je vous direz si il aura un autre probleme
-
@robin4002 j’ai rajouter comme le mods en créen les class mais tjr pas la meem erreur et tjr la
@SidedProxy(clientSide = "fr.atomez.noz43.AtomezClient", serverSide = "fr.atomez.noz43.AtomezServer") public static AtomezCommon proxy1;
j’ai rajouter ça de plus dans le code
strikethrough text -
Pourquoi tu l’as appelé proxy1 ? Vires l’autre ligne qui fait doublon …
-
@robin4002 ça marche mais j’ai un probleme avec mon item mais je ne comprend pas pk
-
@robin4002
l’error---- Minecraft Crash Report ---- // Don't be sad, have a hug! <3 Time: 2/27/22 7:51 PM Description: Initializing game java.lang.NullPointerException: Initializing game at net.minecraftforge.client.model.ModelLoader.setCustomModelResourceLocation(ModelLoader.java:1091) at fr.atomez.noz43.item.ItemLOGOATOMEZ.registerModels(ItemLOGOATOMEZ.java:34) at fr.atomez.noz43.ModsatomezMod.lambda$13(ModsatomezMod.java:100) at java.util.ArrayList.forEach(ArrayList.java:1259) at fr.atomez.noz43.ModsatomezMod.registerModels(ModsatomezMod.java:100) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_19_ModsatomezMod_registerModels_ModelRegistryEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraftforge.fml.client.FMLClientHandler.fireSidedRegistryEvents(FMLClientHandler.java:1062) at net.minecraftforge.fml.common.FMLCommonHandler.fireSidedRegistryEvents(FMLCommonHandler.java:764) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:631) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) at net.minecraft.client.Minecraft.init(Minecraft.java:514) at net.minecraft.client.Minecraft.run(Minecraft.java:422) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraftforge.client.model.ModelLoader.setCustomModelResourceLocation(ModelLoader.java:1091) at fr.atomez.noz43.item.ItemLOGOATOMEZ.registerModels(ItemLOGOATOMEZ.java:34) at fr.atomez.noz43.ModsatomezMod.lambda$13(ModsatomezMod.java:100) at java.util.ArrayList.forEach(ArrayList.java:1259) at fr.atomez.noz43.ModsatomezMod.registerModels(ModsatomezMod.java:100) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_19_ModsatomezMod_registerModels_ModelRegistryEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraftforge.fml.client.FMLClientHandler.fireSidedRegistryEvents(FMLClientHandler.java:1062) at net.minecraftforge.fml.common.FMLCommonHandler.fireSidedRegistryEvents(FMLCommonHandler.java:764) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:631) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) at net.minecraft.client.Minecraft.init(Minecraft.java:514) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:422) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25) -- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_292, AdoptOpenJDK Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), AdoptOpenJDK Memory: 856706248 bytes (817 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.42 Powered by Forge 14.23.5.2847 5 mods loaded, 5 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored | State | ID | Version | Source | Signature | |:----- |:---------- |:------------ |:-------------------------------- |:--------- | | LCH | minecraft | 1.12.2 | minecraft.jar | None | | LCH | mcp | 9.42 | minecraft.jar | None | | LCH | FML | 8.0.99.99 | forgeSrc-1.12.2-14.23.5.2847.jar | None | | LCH | forge | 14.23.5.2847 | forgeSrc-1.12.2-14.23.5.2847.jar | None | | LCH | modsatomez | 1.0.0 | bin | None | Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 456.71' Renderer: 'GeForce GTX 1050/PCIe/SSE2' Launched Version: 1.12.2 LWJGL: 2.9.4 OpenGL: GeForce GTX 1050/PCIe/SSE2 GL version 4.6.0 NVIDIA 456.71, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: Yes 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) CPU: 6x AMD FX(tm)-6300 Six-Core Processor
est dans mon logoatomez.json voia le contenue
{ "parent": "item/generated", "textures": { "layer0": "noz43:items/logoatomez" } }
voila le contenue de l’item
package fr.atomez.noz43.item; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraft.item.ItemStack; import net.minecraft.item.Item; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.block.state.IBlockState; import fr.atomez.noz43.creativetab.TabAtomez; import fr.atomez.noz43.ElementsModsatomezMod; @ElementsModsatomezMod.ModElement.Tag public class ItemLOGOATOMEZ extends ElementsModsatomezMod.ModElement { @GameRegistry.ObjectHolder("noz43:logoatomez") public static final Item block = null; public ItemLOGOATOMEZ(ElementsModsatomezMod instance) { super(instance, 42); } @Override public void initElements() { elements.items.add(() -> new ItemCustom()); } @SideOnly(Side.CLIENT) @Override public void registerModels(ModelRegistryEvent event) { ModelLoader.setCustomModelResourceLocation(block, 0, new ModelResourceLocation("noz43:logoatomez", "inventory")); } public static class ItemCustom extends Item { public ItemCustom() { setMaxDamage(0); maxStackSize = 64; setUnlocalizedName("logoatomez"); setRegistryName("logoatomez"); setCreativeTab(TabAtomez.tab); } @Override public int getItemEnchantability() { return 0; } @Override public int getMaxItemUseDuration(ItemStack itemstack) { return 0; } @Override public float getDestroySpeed(ItemStack par1ItemStack, IBlockState par2Block) { return 1F; } } }
-
Ton item n’est probablement pas enregistré vu que tu as à nouveau un NPE
-
@robin4002 d’ou cette fois si
-
Il suffit de lire les deux premières lignes de ton stack trace :
java.lang.NullPointerException: Initializing game
at net.minecraftforge.client.model.ModelLoader.setCustomModelResourceLocation(ModelLoader.java:1091)
at fr.atomez.noz43.item.ItemLOGOATOMEZ.registerModels(ItemLOGOATOMEZ.java:34)C’est probablement ta variable nommé “block” à la ligne 21 qui reste null.