-
Posts
117 -
Joined
-
Last visited
Everything posted by Delupara
-
UPDATE! not working :'( Edit: fixed it, working code below ---- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward. Time: 14/06/16 3:23 PM Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:266) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:102) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2590) at mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook.onItemRightClick(ItemNoteBook.java:32) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:170) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:471) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1598) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2123) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1080) at net.minecraft.client.Minecraft.run(Minecraft.java:380) at net.minecraft.client.main.Main.main(Main.java:116) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:266) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:102) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2590) at mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook.onItemRightClick(ItemNoteBook.java:32) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:170) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:471) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1598) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player985'/135, l='MpServer', x=-264.40, y=5.01, z=-300.03]] Chunk stats: MultiplayerChunkCache: 330, 330 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: -123.00,4.00,-205.00 - World: (-123,4,-205), Chunk: (at 5,0,3 in -8,-13; contains blocks -128,0,-208 to -113,255,-193), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Level time: 16880 game time, 16880 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 9 total; [EntityVillager['Villager'/16, l='MpServer', x=-196.91, y=5.00, z=-359.69], EntityVillager['Villager'/17, l='MpServer', x=-197.72, y=5.00, z=-358.31], EntityVillager['Villager'/18, l='MpServer', x=-190.72, y=4.00, z=-364.44], EntityVillager['Villager'/20, l='MpServer', x=-187.38, y=5.00, z=-323.34], EntityPlayerSP['Player985'/135, l='MpServer', x=-264.40, y=5.01, z=-300.03], EntitySheep['Sheep'/23, l='MpServer', x=-191.66, y=4.00, z=-307.78], EntityVillager['Villager'/13, l='MpServer', x=-197.72, y=5.00, z=-359.22], EntityVillager['Villager'/14, l='MpServer', x=-197.72, y=5.00, z=-360.59], EntityVillager['Villager'/15, l='MpServer', x=-196.31, y=5.00, z=-360.72]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:383) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2645) at net.minecraft.client.Minecraft.run(Minecraft.java:409) at net.minecraft.client.main.Main.main(Main.java:116) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -- System Details -- Details: Minecraft Version: 1.8.9 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 690236112 bytes (658 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: MCP 9.19 Powered by Forge 11.15.1.1855 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 UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1855.jar) UCHIJAAAA Forge{11.15.1.1855} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1855.jar) UCHIJAAAA sc{0.1} [soul Craft] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13399 Compatibility Profile Context 15.201.1101.0' Renderer: 'AMD Radeon HD 8330' Launched Version: 1.8.9 LWJGL: 2.9.4 OpenGL: AMD Radeon HD 8330 GL version 4.5.13399 Compatibility Profile Context 15.201.1101.0, ATI Technologies Inc. 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: No 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: 4x AMD A4-5000 APU with Radeon(TM) HD Graphics new Clientproxy.java package mod.TGC1.SoulCraft.proxy; import mod.TGC1.SoulCraft.CommonProxy; import mod.TGC1.SoulCraft.References; import mod.TGC1.SoulCraft.init.ModItems; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; public class ClientProxy extends CommonProxy{ @Override public void init() { super.init(); renderAllItems(); } public void renderAllItems() { renderItem(ModItems.NoteBook); } public void renderItem(Item item) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } }
-
[ftp][/ftp] I thought the annotation was to choose whether client or server should be called. I have a bad idea of what proxies are
-
I'm pretty sure it's my dull understanding of annotations. Sorry package mod.TGC1.SoulCraft.proxy; import mod.TGC1.SoulCraft.CommonProxy; import mod.TGC1.SoulCraft.References; import mod.TGC1.SoulCraft.init.ModItems; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; public class ClientProxy extends CommonProxy{ @Override public void init() { renderAllItems(); } public void renderAllItems() { renderItem(ModItems.NoteBook); } public void renderItem(Item item) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } }
-
I did, I originally put it in preinit but it crashed at launch. It's now in my commonproxy package mod.TGC1.SoulCraft; import mod.TGC1.SoulCraft.proxy.ModGuiHandler; import net.minecraftforge.fml.common.network.NetworkRegistry; public class CommonProxy { public void init() { NetworkRegistry.INSTANCE.registerGuiHandler(SoulCraft.SoulCraft, new ModGuiHandler()); } }
-
Because it doesn't change anything (that's not the reason, but it actually really does not prevent crash) ---- Minecraft Crash Report ---- // You should try our sister game, Minceraft! Time: 14/06/16 2:56 PM Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:266) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:102) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2590) at mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook.onItemRightClick(ItemNoteBook.java:32) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:170) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:471) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1598) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2123) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1080) at net.minecraft.client.Minecraft.run(Minecraft.java:380) at net.minecraft.client.main.Main.main(Main.java:116) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:266) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:102) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2590) at mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook.onItemRightClick(ItemNoteBook.java:32) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:170) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:471) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1598) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player835'/134, l='MpServer', x=-264.40, y=5.01, z=-300.03]] Chunk stats: MultiplayerChunkCache: 597, 597 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: -123.00,4.00,-205.00 - World: (-123,4,-205), Chunk: (at 5,0,3 in -8,-13; contains blocks -128,0,-208 to -113,255,-193), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Level time: 16754 game time, 16754 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 9 total; [EntityVillager['Villager'/16, l='MpServer', x=-197.00, y=5.00, z=-359.97], EntityVillager['Villager'/17, l='MpServer', x=-197.72, y=5.00, z=-358.31], EntityVillager['Villager'/18, l='MpServer', x=-197.72, y=5.00, z=-361.53], EntitySheep['Sheep'/19, l='MpServer', x=-191.66, y=4.00, z=-307.78], EntityVillager['Villager'/21, l='MpServer', x=-187.47, y=5.00, z=-322.09], EntityPlayerSP['Player835'/134, l='MpServer', x=-264.40, y=5.01, z=-300.03], EntityVillager['Villager'/13, l='MpServer', x=-197.72, y=5.00, z=-359.16], EntityVillager['Villager'/14, l='MpServer', x=-197.72, y=5.00, z=-360.69], EntityVillager['Villager'/15, l='MpServer', x=-196.31, y=5.00, z=-360.72]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:383) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2645) at net.minecraft.client.Minecraft.run(Minecraft.java:409) at net.minecraft.client.main.Main.main(Main.java:116) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -- System Details -- Details: Minecraft Version: 1.8.9 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 707250328 bytes (674 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: MCP 9.19 Powered by Forge 11.15.1.1855 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 UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1855.jar) UCHIJAAAA Forge{11.15.1.1855} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1855.jar) UCHIJAAAA sc{0.1} [soul Craft] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13399 Compatibility Profile Context 15.201.1101.0' Renderer: 'AMD Radeon HD 8330' Launched Version: 1.8.9 LWJGL: 2.9.4 OpenGL: AMD Radeon HD 8330 GL version 4.5.13399 Compatibility Profile Context 15.201.1101.0, ATI Technologies Inc. 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: No 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: 4x AMD A4-5000 APU with Radeon(TM) HD Graphics
-
Most likely the anotation. ItemNoteBook.java @Override public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) { playerIn.openGui(SoulCraft.SoulCraft, References.MOD_GUI_NOTEBOOK, worldIn,(int) playerIn.posX,(int) playerIn.posY,(int) playerIn.posZ); return itemStackIn; } SoulCraft.java @Mod(modid = References.MOD_ID , name = References.MOD_NAME, version = References.MOD_VERSION) public class SoulCraft { @Mod.Instance("SoulCraft") public static SoulCraft SoulCraft; @SidedProxy(clientSide="mod.TGC1.SoulCraft.proxy.ClientProxy", serverSide="mod.TGC1.SoulCraft.proxy.ServerProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { ModItems.init(); ModItems.registerItems(); proxy.init(); } @EventHandler public void init(FMLInitializationEvent event) { } @EventHandler public static void postInit(FMLPostInitializationEvent event) { } }
-
So I was right to return null... Anyways, enjoy ---- Minecraft Crash Report ---- // Don't be sad. I'll do better next time, I promise! Time: 14/06/16 12:33 AM Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:266) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:102) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2590) at mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook.onItemRightClick(ItemNoteBook.java:31) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:170) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:471) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1598) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2123) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1080) at net.minecraft.client.Minecraft.run(Minecraft.java:380) at net.minecraft.client.main.Main.main(Main.java:116) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:266) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:102) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2590) at mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook.onItemRightClick(ItemNoteBook.java:31) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:170) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:471) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1598) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player172'/134, l='MpServer', x=-264.42, y=5.01, z=-300.05]] Chunk stats: MultiplayerChunkCache: 581, 581 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: -123.00,4.00,-205.00 - World: (-123,4,-205), Chunk: (at 5,0,3 in -8,-13; contains blocks -128,0,-208 to -113,255,-193), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Level time: 16375 game time, 16375 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 9 total; [EntityVillager['Villager'/13, l='MpServer', x=-197.72, y=5.00, z=-360.69], EntityVillager['Villager'/14, l='MpServer', x=-196.31, y=5.00, z=-360.69], EntityVillager['Villager'/15, l='MpServer', x=-197.72, y=5.00, z=-358.31], EntityVillager['Villager'/16, l='MpServer', x=-197.19, y=5.00, z=-359.88], EntityVillager['Villager'/17, l='MpServer', x=-197.72, y=5.00, z=-359.16], EntityVillager['Villager'/18, l='MpServer', x=-197.72, y=5.00, z=-361.53], EntitySheep['Sheep'/19, l='MpServer', x=-192.19, y=4.00, z=-302.81], EntityPlayerSP['Player172'/134, l='MpServer', x=-264.42, y=5.01, z=-300.05], EntityVillager['Villager'/24, l='MpServer', x=-187.47, y=5.00, z=-322.09]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:383) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2645) at net.minecraft.client.Minecraft.run(Minecraft.java:409) at net.minecraft.client.main.Main.main(Main.java:116) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -- System Details -- Details: Minecraft Version: 1.8.9 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 746356016 bytes (711 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: MCP 9.19 Powered by Forge 11.15.1.1855 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 UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1855.jar) UCHIJAAAA Forge{11.15.1.1855} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1855.jar) UCHIJAAAA sc{0.1} [soul Craft] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13399 Compatibility Profile Context 15.201.1101.0' Renderer: 'AMD Radeon HD 8330' Launched Version: 1.8.9 LWJGL: 2.9.4 OpenGL: AMD Radeon HD 8330 GL version 4.5.13399 Compatibility Profile Context 15.201.1101.0, ATI Technologies Inc. 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: No 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: 4x AMD A4-5000 APU with Radeon(TM) HD Graphics
-
what do I return there? I returned null since my only gui so far has no Container/is a basic gui with no slots. but that makes minecraft crash ans forge complain that there's nothing there.
-
Pretty simple. I want a recent 1.9 gui tutorial. I've been looking around and i've only seen 1.8.
-
Item's having a seizure (Animation on updating NBT)
Delupara replied to Delupara's topic in Modder Support
I'm litteraly facepalming rn. -
What exactly do you want to "log"? Do you want to store who entered in a server in a given time (lets say for a block that does X thing) or simply catch the event so that you can do something based on a player's entry in the game? In both you should look at forge events and event handling, these link should help you http://jabelarminecraft.blogspot.ca/p/minecraft-forge-172-event-handling.html http://bedrockminer.jimdo.com/modding-tutorials/advanced-modding/event-handler/ http://minecraftforgetutorials.weebly.com/event-introduction.html And the best tutorial imo: http://greyminecraftcoder.blogspot.ca/2013/12/forge-techniques-events.html
-
I've realized a major flaw in my item: every 1200 ticks, it does something (this thing doesn't matter in this context). I check if 12000 ticks happened by using a NBT value that updates every tick using the method OnUpdate. It works nicely, but sadly the item will make the weird animation where it just goes up and down every tick. I believe this is due to the NBT being updated (or set if you want) I hope someone knows what I'm talking about
-
I was trying something before I came here. I'm not sure what variants (aside from blockstates) are and are used for. I thought that the item has no real variants of itself so I did that. And I didn't knew that registryname included modID. thanks alot.
-
do you need it in client proxy for convention's sake or it will absolutely not work if I call it from ModItems? Because in both cases it did not work. These are the changes I made. ClientProxy.java package mod.TGC1.SoulCraft.proxy; import mod.TGC1.SoulCraft.CommonProxy; import mod.TGC1.SoulCraft.References; import mod.TGC1.SoulCraft.init.ModItems; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; public class ClientProxy extends CommonProxy{ @Override public void init() { renderAllItems(); } public void renderAllItems() { renderItem(ModItems.NoteBook); } public void renderItem(Item item) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(References.MOD_ID + ":" + item.getRegistryName(), null)); } } SoulCraft.java package mod.TGC1.SoulCraft; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import mod.TGC1.SoulCraft.References; import mod.TGC1.SoulCraft.init.ModItems; import mod.TGC1.SoulCraft.proxy.ClientProxy; @Mod(modid = References.MOD_ID , name = References.MOD_NAME, version = References.MOD_VERSION) public class SoulCraft { @Mod.Instance("SoulCraft") public static SoulCraft SoulCraft; @SidedProxy(clientSide="mod.TGC1.SoulCraft.proxy.ClientProxy", serverSide="mod.TGC1.SoulCraft.proxy.ServerProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { ModItems.init(); ModItems.registerItems(); proxy.init(); } @EventHandler public void init(FMLInitializationEvent event) { } @EventHandler public static void postInit(FMLPostInitializationEvent event) { } ModItems.java package mod.TGC1.SoulCraft.init; import mod.TGC1.SoulCraft.References; import mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModItems { public static Item NoteBook; public static void init() { NoteBook = new ItemNoteBook(); } //registers all the Items. public static void registerItems() { register(NoteBook, "NoteBook"); } public static void register(Item item,String string) { GameRegistry.registerItem(item, string); } }
-
Someone told me to not use ItemModelMesher#register and use ModelLoader#CustomModelLocation instead. Though This made my resources break. They won't show at all. SoulCraft.java package mod.TGC1.SoulCraft; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import mod.TGC1.SoulCraft.References; import mod.TGC1.SoulCraft.init.ModItems; import mod.TGC1.SoulCraft.proxy.ClientProxy; @Mod(modid = References.MOD_ID , name = References.MOD_NAME, version = References.MOD_VERSION) public class SoulCraft { @Mod.Instance("SoulCraft") public static SoulCraft SoulCraft; @SidedProxy(clientSide="mod.TGC1.SoulCraft.proxy.ClientProxy", serverSide="mod.TGC1.SoulCraft.proxy.ServerProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { ModItems.init(); ModItems.registerItems(); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(); } @EventHandler public static void postInit(FMLPostInitializationEvent event) { } } ClientProxy.java package mod.TGC1.SoulCraft.proxy; import mod.TGC1.SoulCraft.CommonProxy; import mod.TGC1.SoulCraft.init.ModItems; public class ClientProxy extends CommonProxy{ @Override public void init() { ModItems.registerItemRenders(); } } ModItems.java package mod.TGC1.SoulCraft.init; import mod.TGC1.SoulCraft.References; import mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModItems { public static Item NoteBook; public static void init() { NoteBook = new ItemNoteBook(); } //registers all the Items. public static void registerItems() { register(NoteBook, "NoteBook"); } public static void registerItemRenders() { registerRender(NoteBook); } public static void register(Item item,String string) { GameRegistry.registerItem(item, string); } public static void registerRender(Item item) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(References.MOD_ID + ":" + item.getRegistryName(), null)); } } Idk if im implementing the function correctly, also I know my variable naming convention is not right, don't remind me I know.
-
My knawlidge isn't working [what is NBT baby don't hurt me no more].
Delupara replied to Delupara's topic in Modder Support
This woudn't prevent crashing (since it would just not go in the if statement, thus keeping both values to 0), but it did escaped my mind. Thanks. -
My knawlidge isn't working [what is NBT baby don't hurt me no more].
Delupara replied to Delupara's topic in Modder Support
It will be used in the future because there will be other properties that will require #onCreated specifically. This, too, doesn't help the crash. Thanks anyway -
My knawlidge isn't working [what is NBT baby don't hurt me no more].
Delupara replied to Delupara's topic in Modder Support
It was temporary until I make it work. Since it was my only item and block in the mod Regardless, This doesn't help the actual issue boo boo. Thanks anyway -
My knawlidge isn't working [what is NBT baby don't hurt me no more].
Delupara replied to Delupara's topic in Modder Support
You left out the actual exception. Next time post the whole crash report. edited, sowy. -
My knawlidge isn't working [what is NBT baby don't hurt me no more].
Delupara replied to Delupara's topic in Modder Support
If you did had psychic I would of probably asked how I can get some XDDDDDDDD. completely forgot ---- Minecraft Crash Report ---- // Oh - I know what I did wrong! Time: 04/06/16 1:10 AM Description: Ticking entity java.lang.NullPointerException: Ticking entity at mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook.onUpdate(ItemNoteBook.java:49) at net.minecraft.item.ItemStack.updateAnimation(ItemStack.java:502) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:350) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:611) at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:912) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1824) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:323) at net.minecraft.client.entity.EntityPlayerSP.onUpdate(EntityPlayerSP.java:163) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2011) at net.minecraft.world.World.updateEntity(World.java:1976) at net.minecraft.world.World.updateEntities(World.java:1805) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2176) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1080) at net.minecraft.client.Minecraft.run(Minecraft.java:380) at net.minecraft.client.main.Main.main(Main.java:116) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at mod.TGC1.SoulCraft.Customs.Items.ItemNoteBook.onUpdate(ItemNoteBook.java:49) at net.minecraft.item.ItemStack.updateAnimation(ItemStack.java:502) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:350) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:611) at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:912) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1824) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:323) at net.minecraft.client.entity.EntityPlayerSP.onUpdate(EntityPlayerSP.java:163) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2011) at net.minecraft.world.World.updateEntity(World.java:1976) -- Entity being ticked -- Details: Entity Type: null (net.minecraft.client.entity.EntityPlayerSP) Entity ID: 126 Entity Name: Player915 Entity's Exact location: 1158.25, 4.00, -1034.20 Entity's Block location: 1158.00,4.00,-1035.00 - World: (1158,4,-1035), Chunk: (at 6,0,5 in 72,-65; contains blocks 1152,0,-1040 to 1167,255,-1025), Region: (2,-3; contains chunks 64,-96 to 95,-65, blocks 1024,0,-1536 to 1535,255,-1025) Entity's Momentum: 0.00, 0.00, 0.00 Entity's Rider: ~~ERROR~~ NullPointerException: null Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.world.World.updateEntities(World.java:1805) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player915'/126, l='MpServer', x=1158.25, y=4.00, z=-1034.20]] Chunk stats: MultiplayerChunkCache: 621, 621 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: 1162.00,4.00,-1026.00 - World: (1162,4,-1026), Chunk: (at 10,0,14 in 72,-65; contains blocks 1152,0,-1040 to 1167,255,-1025), Region: (2,-3; contains chunks 64,-96 to 95,-65, blocks 1024,0,-1536 to 1535,255,-1025) Level time: 2084 game time, 2084 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 64 total; [EntitySlime['Slime'/18, l='MpServer', x=1087.00, y=4.47, z=-991.22], EntitySlime['Slime'/19, l='MpServer', x=1087.25, y=4.00, z=-979.50], EntitySlime['Slime'/24, l='MpServer', x=1080.78, y=4.00, z=-1113.94], EntitySlime['Slime'/25, l='MpServer', x=1095.16, y=4.00, z=-1096.69], EntitySlime['Slime'/26, l='MpServer', x=1095.19, y=5.22, z=-1090.34], EntitySlime['Slime'/27, l='MpServer', x=1094.50, y=4.00, z=-1088.19], EntitySlime['Slime'/28, l='MpServer', x=1091.03, y=4.00, z=-1070.34], EntitySlime['Slime'/29, l='MpServer', x=1107.97, y=4.75, z=-1087.19], EntitySlime['Slime'/30, l='MpServer', x=1095.53, y=4.00, z=-1076.91], EntitySlime['Slime'/31, l='MpServer', x=1093.38, y=4.00, z=-1003.66], EntitySlime['Slime'/32, l='MpServer', x=1092.91, y=4.47, z=-972.91], EntityCow['Cow'/38, l='MpServer', x=1108.31, y=4.00, z=-1114.25], EntityCow['Cow'/41, l='MpServer', x=1106.53, y=4.00, z=-1089.38], EntityCow['Cow'/42, l='MpServer', x=1110.22, y=4.00, z=-1089.50], EntityCow['Cow'/43, l='MpServer', x=1111.47, y=4.00, z=-1088.41], EntityCow['Cow'/44, l='MpServer', x=1106.09, y=4.00, z=-1092.00], EntitySlime['Slime'/45, l='MpServer', x=1112.41, y=4.00, z=-1094.97], EntityCow['Cow'/46, l='MpServer', x=1111.75, y=4.00, z=-1087.28], EntityCow['Cow'/47, l='MpServer', x=1108.00, y=4.00, z=-1094.97], EntityCow['Cow'/48, l='MpServer', x=1115.81, y=4.00, z=-1082.22], EntityCow['Cow'/49, l='MpServer', x=1108.50, y=4.00, z=-1085.50], EntityCow['Cow'/50, l='MpServer', x=1109.03, y=4.00, z=-1080.16], EntityCow['Cow'/51, l='MpServer', x=1097.53, y=4.00, z=-1073.78], EntitySlime['Slime'/52, l='MpServer', x=1114.81, y=4.00, z=-1071.63], EntitySlime['Slime'/53, l='MpServer', x=1116.09, y=4.00, z=-1035.59], EntitySlime['Slime'/54, l='MpServer', x=1115.13, y=5.22, z=-1020.88], EntitySlime['Slime'/55, l='MpServer', x=1105.94, y=4.00, z=-997.44], EntitySlime['Slime'/56, l='MpServer', x=1121.28, y=4.00, z=-989.94], EntitySlime['Slime'/57, l='MpServer', x=1118.75, y=4.00, z=-961.69], EntitySlime['Slime'/58, l='MpServer', x=1114.50, y=4.00, z=-962.03], EntitySlime['Slime'/59, l='MpServer', x=1126.63, y=5.22, z=-955.28], EntityRabbit['Rabbit'/60, l='MpServer', x=1130.53, y=4.00, z=-1073.94], EntityPig['Pig'/61, l='MpServer', x=1126.78, y=4.00, z=-1074.91], EntityCow['Cow'/62, l='MpServer', x=1126.72, y=4.00, z=-1080.38], EntityPig['Pig'/63, l='MpServer', x=1135.72, y=4.00, z=-1072.22], EntitySheep['Sheep'/64, l='MpServer', x=1126.81, y=4.00, z=-1078.81], EntityPig['Pig'/65, l='MpServer', x=1133.41, y=4.00, z=-1070.00], EntityPig['Pig'/66, l='MpServer', x=1115.03, y=4.00, z=-1067.03], EntityRabbit['Rabbit'/67, l='MpServer', x=1127.31, y=4.00, z=-1067.34], EntityRabbit['Rabbit'/68, l='MpServer', x=1132.47, y=4.00, z=-1070.84], EntityRabbit['Rabbit'/69, l='MpServer', x=1134.56, y=4.00, z=-1070.41], EntitySheep['Sheep'/70, l='MpServer', x=1133.00, y=4.00, z=-1062.06], EntitySlime['Slime'/71, l='MpServer', x=1124.94, y=4.00, z=-1017.03], EntitySlime['Slime'/72, l='MpServer', x=1132.34, y=4.00, z=-1012.81], EntitySlime['Slime'/73, l='MpServer', x=1116.72, y=4.00, z=-1011.13], EntitySlime['Slime'/74, l='MpServer', x=1129.44, y=4.00, z=-998.31], EntitySlime['Slime'/75, l='MpServer', x=1124.84, y=4.00, z=-993.94], EntitySlime['Slime'/76, l='MpServer', x=1140.81, y=4.78, z=-989.09], EntitySlime['Slime'/77, l='MpServer', x=1131.84, y=4.00, z=-987.25], EntitySlime['Slime'/78, l='MpServer', x=1130.19, y=5.00, z=-975.09], EntitySheep['Sheep'/83, l='MpServer', x=1141.16, y=4.00, z=-1062.19], EntitySlime['Slime'/84, l='MpServer', x=1129.81, y=4.00, z=-1011.41], EntitySlime['Slime'/85, l='MpServer', x=1145.81, y=4.41, z=-975.41], EntitySlime['Slime'/86, l='MpServer', x=1152.13, y=4.00, z=-1082.16], EntitySlime['Slime'/87, l='MpServer', x=1171.44, y=4.00, z=-995.72], EntitySlime['Slime'/89, l='MpServer', x=1170.53, y=4.00, z=-1109.47], EntitySlime['Slime'/90, l='MpServer', x=1177.06, y=5.22, z=-1100.44], EntitySlime['Slime'/91, l='MpServer', x=1180.66, y=4.78, z=-1005.25], EntitySlime['Slime'/92, l='MpServer', x=1170.53, y=5.16, z=-997.63], EntitySlime['Slime'/94, l='MpServer', x=1189.16, y=5.22, z=-1112.53], EntityPlayerSP['Player915'/126, l='MpServer', x=1158.25, y=4.00, z=-1034.20], EntitySlime['Slime'/95, l='MpServer', x=1182.97, y=4.00, z=-1100.25], EntitySlime['Slime'/107, l='MpServer', x=1187.75, y=4.75, z=-1099.25], EntitySlime['Slime'/108, l='MpServer', x=1230.88, y=5.00, z=-1047.03]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:383) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2645) at net.minecraft.client.Minecraft.run(Minecraft.java:401) at net.minecraft.client.main.Main.main(Main.java:116) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -
I started to touch NBT and particles, I wanted to have a notebook that randomly got knawlidge (and If I didn't, increased the chances to get knawlidge ) while carrying it in my inventory. If i got knowledge, the next time I would of hold it in my hand it would create particles at my head (I chose enchantement table particles idk y lol XDDDDDDDDDDDDDDDD) and if it was in my hand when I got knowledge it would create the particles at my head. I got an issue though. I can't use or even put my inventory because the item class explodes all teh time... My ItemNoteBook package mod.TGC1.SoulCraft.Customs.Items; import java.util.Random; import mod.TGC1.SoulCraft.init.ModItems; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ItemNoteBook extends Item { public ItemNoteBook() { this.setUnlocalizedName("NoteBook"); this.setRegistryName("NoteBook"); this.setCreativeTab(new CreativeTabs("Soul Craft"){ @SideOnly(Side.CLIENT) public Item getTabIconItem() { return ModItems.NoteBook; } }); } @Override public void onCreated(ItemStack stack, World worldIn, EntityPlayer playerIn) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("knawlidge", 0); nbt.setInteger("knaw%", 0); nbt.setBoolean("WillSparkle", false); if(stack.hasTagCompound() || stack.getTagCompound() == null) stack.setTagCompound(nbt); } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { int knowledge = 0; int knowP = 0; NBTTagCompound nbt = stack.getTagCompound(); if(nbt.hasKey("knawlidge") && nbt.hasKey("knaw%")) //Error starts here.... { knowledge = nbt.getInteger("knawlidge"); knowP = nbt.getInteger("knaw%"); } Random Value = worldIn.rand; boolean IsLearning = (Value.nextInt(51) + knowP) >= 100; if(IsLearning) { if(isSelected) { worldIn.spawnParticle(EnumParticleTypes.ENCHANTMENT_TABLE, entityIn.posX, entityIn.posY + 1, entityIn.posZ, 0.0, 0.0, 0.0, 1); nbt.setBoolean("WillSparkle", false); }else { nbt.setBoolean("WillSparkle", true); } nbt.setInteger("knawlidge", knowledge + 1); }else { nbt.setInteger("knaw%", knowP + Value.nextInt(11)); } } }
-
Okay I'm talking about basic rendering, not overly complicated versions of rendering. You can't draw a masterpieces without knowing how to use a pencil! Take for example a snippet of code Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getRegistryName, "inventory")); I know what minecraft#getMinecraft is but not Minecraft#getRenderItem nor RenderItem#getItemModelMesher and even less ItemModelMesher#register These are super basic yet I don't understand any of it.