Posted December 28, 20168 yr I want to create a tomato plant. So far, the plant works fine. The thing is, when I right click the seeds to plant the plant, the game crashes. I'm not sure what to make of the crash log. ---- Minecraft Crash Report ---- // Hi. I'm Minecraft, and I'm a crashaholic. Time: 12/27/16 5:11 PM Description: Unexpected error java.lang.NullPointerException: Unexpected error at com.stinkycow8.crop.TomatoCropItemBase.getPlant(TomatoCropItemBase.java:42) at net.minecraft.block.Block.canSustainPlant(Block.java:1910) at net.minecraft.item.ItemSeedFood.onItemUse(ItemSeedFood.java:39) at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:147) at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:442) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1571) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2131) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087) at net.minecraft.client.Minecraft.run(Minecraft.java:376) at net.minecraft.client.main.Main.main(Main.java:117) 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(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 com.stinkycow8.crop.TomatoCropItemBase.getPlant(TomatoCropItemBase.java:42) at net.minecraft.block.Block.canSustainPlant(Block.java:1910) at net.minecraft.item.ItemSeedFood.onItemUse(ItemSeedFood.java:39) at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:147) at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:442) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1571) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player566'/279, l='MpServer', x=-261.99, y=65.00, z=-213.79]] Chunk stats: MultiplayerChunkCache: 564, 564 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: -252.00,64.00,-212.00 - World: (-252,64,-212), Chunk: (at 4,4,12 in -16,-14; contains blocks -256,0,-224 to -241,255,-209), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1) Level time: 2486 game time, 2486 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: 102 total; [EntityPlayerSP['Player566'/279, l='MpServer', x=-261.99, y=65.00, z=-213.79], EntitySheep['Sheep'/59, l='MpServer', x=-337.50, y=63.00, z=-261.50], EntitySheep['Sheep'/60, l='MpServer', x=-336.22, y=63.00, z=-258.72], EntitySheep['Sheep'/69, l='MpServer', x=-335.59, y=63.00, z=-269.78], EntitySquid['Squid'/70, l='MpServer', x=-320.53, y=59.66, z=-183.94], EntitySkeleton['Skeleton'/71, l='MpServer', x=-326.59, y=14.00, z=-169.53], EntitySkeleton['Skeleton'/72, l='MpServer', x=-329.56, y=20.00, z=-158.47], EntityBat['Bat'/74, l='MpServer', x=-331.25, y=14.10, z=-145.44], EntityBat['Bat'/75, l='MpServer', x=-330.66, y=15.10, z=-142.25], EntityBat['Bat'/76, l='MpServer', x=-321.59, y=17.10, z=-144.47], EntitySpider['Spider'/82, l='MpServer', x=-305.25, y=12.00, z=-184.25], EntitySquid['Squid'/83, l='MpServer', x=-318.66, y=54.66, z=-185.66], EntitySkeleton['Skeleton'/84, l='MpServer', x=-309.13, y=19.00, z=-168.50], EntityCreeper['Creeper'/85, l='MpServer', x=-315.56, y=17.00, z=-171.66], EntitySkeleton['Skeleton'/86, l='MpServer', x=-319.44, y=17.00, z=-173.91], EntitySkeleton['Skeleton'/87, l='MpServer', x=-302.31, y=18.00, z=-170.09], EntitySkeleton['Skeleton'/88, l='MpServer', x=-304.56, y=17.00, z=-154.91], EntitySheep['Sheep'/90, l='MpServer', x=-295.28, y=64.00, z=-225.56], EntitySheep['Sheep'/91, l='MpServer', x=-293.16, y=64.00, z=-210.03], EntityBat['Bat'/92, l='MpServer', x=-295.31, y=13.10, z=-191.50], EntitySkeleton['Skeleton'/93, l='MpServer', x=-303.19, y=12.00, z=-167.56], EntitySkeleton['Skeleton'/99, l='MpServer', x=-273.56, y=57.00, z=-261.13], EntityItem['item.item.seeds'/100, l='MpServer', x=-285.50, y=63.00, z=-247.53], EntitySheep['Sheep'/101, l='MpServer', x=-278.84, y=63.00, z=-230.91], EntityCreeper['Creeper'/102, l='MpServer', x=-280.69, y=41.00, z=-209.94], EntitySquid['Squid'/103, l='MpServer', x=-279.25, y=57.53, z=-165.47], EntityZombie['Zombie'/113, l='MpServer', x=-250.97, y=15.00, z=-183.69], EntityCreeper['Creeper'/114, l='MpServer', x=-258.75, y=22.25, z=-187.09], EntitySquid['Squid'/115, l='MpServer', x=-260.59, y=58.41, z=-169.16], EntitySquid['Squid'/116, l='MpServer', x=-265.31, y=55.25, z=-170.53], EntityZombie['Zombie'/127, l='MpServer', x=-253.63, y=27.00, z=-289.88], EntitySkeleton['Skeleton'/128, l='MpServer', x=-248.19, y=28.00, z=-280.66], EntitySheep['Sheep'/129, l='MpServer', x=-244.59, y=66.00, z=-230.63], EntitySheep['Sheep'/130, l='MpServer', x=-249.44, y=66.00, z=-226.44], EntitySheep['Sheep'/131, l='MpServer', x=-249.97, y=68.00, z=-220.03], EntityZombie['Zombie'/132, l='MpServer', x=-255.16, y=21.00, z=-208.81], EntitySkeleton['Skeleton'/133, l='MpServer', x=-247.53, y=14.00, z=-196.50], EntityZombie['Zombie'/134, l='MpServer', x=-248.09, y=21.00, z=-196.50], EntityZombie['Zombie'/135, l='MpServer', x=-255.50, y=17.00, z=-174.50], EntitySkeleton['Skeleton'/143, l='MpServer', x=-226.88, y=16.00, z=-289.47], EntityBat['Bat'/145, l='MpServer', x=-247.45, y=19.02, z=-257.22], EntitySheep['Sheep'/147, l='MpServer', x=-237.19, y=74.00, z=-216.53], EntitySkeleton['Skeleton'/148, l='MpServer', x=-230.59, y=20.00, z=-202.56], EntityCreeper['Creeper'/149, l='MpServer', x=-233.50, y=21.00, z=-198.19], EntityCreeper['Creeper'/150, l='MpServer', x=-232.50, y=23.00, z=-183.72], EntityCreeper['Creeper'/151, l='MpServer', x=-232.56, y=25.00, z=-188.06], EntityCreeper['Creeper'/152, l='MpServer', x=-230.53, y=24.00, z=-182.00], EntitySkeleton['Skeleton'/153, l='MpServer', x=-225.13, y=32.00, z=-146.47], EntitySpider['Spider'/156, l='MpServer', x=-214.31, y=39.00, z=-269.78], EntitySkeleton['Skeleton'/157, l='MpServer', x=-220.75, y=18.00, z=-252.19], EntitySheep['Sheep'/158, l='MpServer', x=-219.56, y=110.00, z=-249.00], EntitySheep['Sheep'/159, l='MpServer', x=-220.75, y=110.00, z=-248.88], EntitySheep['Sheep'/160, l='MpServer', x=-215.94, y=112.00, z=-232.09], EntitySheep['Sheep'/161, l='MpServer', x=-216.56, y=112.00, z=-241.47], EntityCreeper['Creeper'/162, l='MpServer', x=-220.56, y=21.00, z=-225.00], EntityBat['Bat'/163, l='MpServer', x=-221.67, y=53.23, z=-225.88], EntitySkeleton['Skeleton'/164, l='MpServer', x=-217.50, y=27.00, z=-205.31], EntityZombie['Zombie'/165, l='MpServer', x=-219.09, y=29.00, z=-201.63], EntitySkeleton['Skeleton'/166, l='MpServer', x=-221.91, y=18.00, z=-189.44], EntitySkeleton['Skeleton'/167, l='MpServer', x=-220.84, y=17.00, z=-184.38], EntityCreeper['Creeper'/168, l='MpServer', x=-208.78, y=29.00, z=-165.59], EntityEnderman['Enderman'/169, l='MpServer', x=-221.22, y=32.00, z=-166.50], EntityEnderman['Enderman'/170, l='MpServer', x=-224.09, y=31.00, z=-146.47], EntityBat['Bat'/171, l='MpServer', x=-215.75, y=28.72, z=-151.60], EntityCreeper['Creeper'/172, l='MpServer', x=-214.94, y=34.00, z=-157.53], EntitySheep['Sheep'/175, l='MpServer', x=-194.16, y=100.00, z=-288.56], EntitySheep['Sheep'/176, l='MpServer', x=-201.09, y=99.00, z=-292.00], EntityZombie['Zombie'/177, l='MpServer', x=-198.03, y=23.00, z=-275.59], EntitySkeleton['Skeleton'/178, l='MpServer', x=-197.13, y=23.00, z=-277.53], EntityZombie['Zombie'/179, l='MpServer', x=-194.56, y=22.00, z=-282.06], EntitySheep['Sheep'/180, l='MpServer', x=-202.56, y=101.00, z=-272.13], EntitySheep['Sheep'/181, l='MpServer', x=-205.97, y=99.00, z=-287.03], EntityBat['Bat'/182, l='MpServer', x=-202.75, y=23.28, z=-272.53], EntityBat['Bat'/183, l='MpServer', x=-191.51, y=55.21, z=-254.73], EntityCreeper['Creeper'/184, l='MpServer', x=-202.53, y=20.00, z=-208.03], EntityBat['Bat'/185, l='MpServer', x=-201.01, y=22.01, z=-210.18], EntityBat['Bat'/186, l='MpServer', x=-195.26, y=19.01, z=-205.27], EntitySkeleton['Skeleton'/187, l='MpServer', x=-193.28, y=31.00, z=-192.78], EntityCreeper['Creeper'/188, l='MpServer', x=-207.97, y=29.00, z=-164.50], EntityZombie['Zombie'/189, l='MpServer', x=-207.72, y=29.00, z=-166.63], EntitySpider['Spider'/192, l='MpServer', x=-192.72, y=15.00, z=-140.22], EntitySkeleton['Skeleton'/193, l='MpServer', x=-204.50, y=15.00, z=-136.50], EntitySkeleton['Skeleton'/194, l='MpServer', x=-203.50, y=15.00, z=-137.50], EntitySkeleton['Skeleton'/195, l='MpServer', x=-202.16, y=15.00, z=-134.56], EntitySkeleton['Skeleton'/196, l='MpServer', x=-202.00, y=15.00, z=-135.88], EntitySpider['Spider'/197, l='MpServer', x=-200.03, y=15.00, z=-138.31], EntitySheep['Sheep'/204, l='MpServer', x=-182.34, y=100.00, z=-282.56], EntitySheep['Sheep'/205, l='MpServer', x=-190.53, y=98.00, z=-265.13], EntitySheep['Sheep'/206, l='MpServer', x=-189.09, y=109.00, z=-256.56], EntitySheep['Sheep'/207, l='MpServer', x=-183.13, y=98.00, z=-269.91], EntityBat['Bat'/208, l='MpServer', x=-188.47, y=55.10, z=-253.44], EntityBat['Bat'/209, l='MpServer', x=-191.69, y=55.01, z=-254.29], EntitySheep['Sheep'/210, l='MpServer', x=-182.72, y=121.00, z=-243.16], EntitySheep['Sheep'/212, l='MpServer', x=-187.09, y=113.00, z=-233.44], EntitySheep['Sheep'/213, l='MpServer', x=-188.88, y=113.00, z=-231.78], EntitySheep['Sheep'/214, l='MpServer', x=-183.75, y=113.00, z=-228.19], EntityCreeper['Creeper'/215, l='MpServer', x=-191.81, y=31.00, z=-192.16], EntitySkeleton['Skeleton'/216, l='MpServer', x=-191.50, y=15.00, z=-166.50], EntitySpider['Spider'/217, l='MpServer', x=-189.50, y=15.00, z=-161.50], EntityCreeper['Creeper'/218, l='MpServer', x=-186.56, y=10.00, z=-174.72], EntitySkeleton['Skeleton'/219, l='MpServer', x=-184.56, y=28.00, z=-174.22], EntityZombie['Zombie'/220, l='MpServer', x=-185.56, y=30.00, z=-159.31]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2614) at net.minecraft.client.Minecraft.run(Minecraft.java:405) at net.minecraft.client.main.Main.main(Main.java:117) 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(Unknown Source) at GradleStart.main(Unknown Source) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Mac OS X (x86_64) version 10.12.2 Java Version: 1.8.0_112, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 753134904 bytes (718 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.4.1563 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.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1563.jar) UCHIJAAAA Forge{11.14.4.1563} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1563.jar) UCHIJAAAA restaurantmod{1.0} [Restaurant Mod] (bin) Loaded coremods (and transformers): Launched Version: 1.8 LWJGL: 2.9.2 OpenGL: AMD Radeon Pro 450 OpenGL Engine GL version 2.1 ATI-1.48.16, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because ARB_framebuffer_object 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) Line 42 of com.stinkycow8.crop.TomateCropItemBase (referred to in the crash log) is @Override public IBlockState getPlant(IBlockAccess world, BlockPos pos) { return associatedCropBlock.getDefaultState(); THIS IS LINE 42 } Obviously, "THIS IS LINE 42" is not in the actual code.
December 28, 20168 yr I believe you are initializing your items before your blocks, so you are passing a null block to your item. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
December 28, 20168 yr It's a null pointer exception at line 42. The only variable at line 42 is associatedCropBlock , so this must be null when the method is called. Where do you initialise this? Post your whole crop class.
December 28, 20168 yr I believe you are initializing your items before your blocks, so you are passing a null block to your item. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
December 28, 20168 yr Do a Google search on Minecraft Forge crop seed crash and count the hits (and be chagrined -- I got 402,000+, which is just a few more than the number of threads I've seen in the last three years). The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.