---- Minecraft Crash Report ----
// Don't be sad. I'll do better next time, I promise!
Time: 5/3/16 6:04 PM
Description: Exception in server tick loop
java.lang.NullPointerException: Exception in server tick loop
at com.mogames.mod.handler.MGDropHandler.addBlockDrop(MGDropHandler.java:34)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_7_MGDropHandler_addBlockDrop_HarvestDropsEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:189)
at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:626)
at net.minecraft.block.Block.dropBlockAsItem(Block.java:615)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:169)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:132)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:132)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.World.forceBlockUpdateTick(World.java:2836)
at net.minecraft.world.gen.feature.WorldGenLiquids.generate(WorldGenLiquids.java:82)
at net.minecraft.world.biome.BiomeDecorator.genDecorations(BiomeDecorator.java:400)
at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:136)
at net.minecraft.world.biome.BiomeGenBase.decorate(BiomeGenBase.java:404)
at net.minecraft.world.biome.BiomeGenJungle.decorate(BiomeGenJungle.java:71)
at net.minecraft.world.gen.ChunkProviderGenerate.populate(ChunkProviderGenerate.java:473)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:283)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1156)
at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:187)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:129)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:99)
at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:347)
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:110)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:127)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:508)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.8.9
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_91, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 735193352 bytes (701 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 1, tcache: 1, allocated: 12, tallocated: 94
FML: MCP 9.19 Powered by Forge 11.15.1.1722 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
UCHIJAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
UCHIJAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1722.jar)
UCHIJAA Forge{11.15.1.1722} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1722.jar)
UCHIJAA MG{v 0.1 Beta} [mogames Mod] (bin)
Loaded coremods (and transformers):
GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
Profiler Position: N/A (disabled)
Player Count: 0 / 8; []
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
Okay. First of all, please provide details. How are we supposed to help you if you're not even saying what goes wrong or even what you're trying to do.
Also, please read the stacktrace:
java.lang.NullPointerException: Exception in server tick loop
at com.mogames.mod.handler.MGDropHandler.addBlockDrop(MGDropHandler.java:34)
what is the null object, I looked over the drop class?
It's StrawBerryseeds in line 34.
Is it spelled right that way or should it state StrawBerrySeeds?
Also the random method can return 0, which results in an ItemStack with a StackSize of 0, which turns the whole object to null.
It's StrawBerryseeds in line 34.
Is it spelled right that way or should it state StrawBerrySeeds?
Also the random method can return 0, which results in an ItemStack with a StackSize of 0, which turns the whole object to null.
That cannot be the issue, as an ArrayList will let you add null without problem.
You simply add 1 (or any positive number) to the result of Random#nextInt
We can't give you code, because we're not the ones writing your mod. If you don't understand what we mean, you might not know what you're doing -- and if that's the case, it will be very hard to help you until you understand Java better.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
public class MGItems {
//tools
public static ToolMaterial RUBYTOOLS = EnumHelper.addToolMaterial("RUBYTOOLS", 3, 1050, 12.0F, 4.0F, 20);
public static ToolMaterial SAPPHIRETOOLS = EnumHelper.addToolMaterial("SAPPHIRETOOLS", 3, 1050, 11.0F, 3.5F, 20);
public static ToolMaterial EMERALDTOOLS = EnumHelper.addToolMaterial("EMERALDTOOLS", 4, 1600, 15.0F, 4.5F, 25);
public static ToolMaterial SEEDFINDER = EnumHelper.addToolMaterial("SEEDFINDER", 2, 400, 10.0F, 5.0F, 25);
//Armor
public static ArmorMaterial RUBYARMOR = EnumHelper.addArmorMaterial("RUBYARMOR", MGGlobal.Mod_ID + ":" + "ruby",20 , new int[]{2,6,5,4}, 25);
public static ArmorMaterial EMERALDARMOR = EnumHelper.addArmorMaterial("EMERALDARMOR", MGGlobal.Mod_ID + ":" + "emerald",20 , new int[]{2,7,6,4}, 25);
public static ArmorMaterial NIGHTVIS = EnumHelper.addArmorMaterial("NightVis", MGGlobal.Mod_ID + ":" + "NightVis",20 , new int[]{1,0,0,0}, 25);
public static Item RubyHelmet;
public static Item RubyChestplate;
public static Item RubyLeggings;
public static Item RubyBoots;
public static Item EmeraldHelmet;
public static Item EmeraldChestplate;
public static Item EmeraldLeggings;
public static Item EmeraldBoots;
public static Item RubyPickaxe;
public static Item RubyAxe;
public static Item RubyHoe;
public static Item RubySpade;
public static Item RubySword;
public static Item SapphirePickaxe;
public static Item SapphireAxe;
public static Item SapphireHoe;
public static Item SapphireSpade;
public static Item SapphireSword;
public static Item EmeraldPickaxe;
public static Item EmeraldAxe;
public static Item EmeraldHoe;
public static Item EmeraldSpade;
public static Item EmeraldSword;
public static Item SeedFinder;
//Food
public static Item PitaBread;
public static Item StrawBerryFood;
public static Item TomatoFood;
public static Item BeetFood;
public static Item LettuceFood;
public static Item PickleFood;
//Crops
public static Item StrawBerryseeds;
public static Item TomatoSeeds;
public static Item BeetSeeds;
public static Item LettuceSeeds;
public static Item PickleSeeds;
//Ingot
public static Item copperIngot;
public static Item Ruby;
public static Item Sapphire;
public static Item NickelIngot;
public static Item TitaniumIngot;
public static Item Peridot;
public static Item PlutoniumIngot;
public static Item Amyethyst;
public static Item RedDiamond;
public static Item YellowDiamond;
public static Item GreenDiamond;
//Other
public static Item Energon;
public static Item NightVis;
public static void initItems() {
//tools
GameRegistry.registerItem(RubyPickaxe = new MGRubyPickaxe("RubyPickaxe", RUBYTOOLS),"RubyPickaxe");
GameRegistry.registerItem(RubyAxe = new MGRubyAxe("RubyAxe", RUBYTOOLS), "RubyAxe");
GameRegistry.registerItem(RubyHoe = new MGRubyHoe("RubyHoe", RUBYTOOLS),"RubyHoe");
GameRegistry.registerItem(RubySpade = new MGRubySpade("RubySpade", RUBYTOOLS), "RubySpade");
GameRegistry.registerItem(RubySword = new MGRubySword("RubySword", RUBYTOOLS),"RubySword");
GameRegistry.registerItem(SapphirePickaxe = new MGSapphirePickaxe("SapphirePickaxe", SAPPHIRETOOLS),"SapphirePickaxe");
GameRegistry.registerItem(SapphireAxe = new MGSapphireAxe("SapphireAxe", SAPPHIRETOOLS), "SapphireAxe");
GameRegistry.registerItem(SapphireHoe = new MGSappphireHoe("SapphireHoe", SAPPHIRETOOLS),"SapphireHoe");
GameRegistry.registerItem(SapphireSpade = new MGSapphireSpade("SapphireSpade", SAPPHIRETOOLS), "SapphireSpade");
GameRegistry.registerItem(SapphireSword = new MGSapphireSword("SapphireSword", SAPPHIRETOOLS),"SapphireSword");
GameRegistry.registerItem(EmeraldPickaxe = new MGEmeraldPickaxe("EmeraldPickaxe", EMERALDTOOLS),"EmeraldPickaxe");
GameRegistry.registerItem(EmeraldAxe = new MGEmeraldAxe("EmeraldAxe", EMERALDTOOLS), "EmeraldAxe");
GameRegistry.registerItem(EmeraldHoe = new MGEmeraldHoe("EmeraldHoe", EMERALDTOOLS),"EmeraldHoe");
GameRegistry.registerItem(EmeraldSpade = new MGEmeraldSpade("EmeraldSpade", EMERALDTOOLS), "EmeraldSpade");
GameRegistry.registerItem(EmeraldSword = new MGEmeraldSword("EmeraldSword", EMERALDTOOLS),"EmeraldSword");
GameRegistry.registerItem(NightVis = new MGNIGHTVIS("NightVis", NIGHTVIS, 1, 0),"NightVis");
//Armor
GameRegistry.registerItem(RubyHelmet = new MGRubyArmor("RubyHelmet" , RUBYARMOR, 1, 0), "RubyHelmet");
GameRegistry.registerItem(RubyChestplate = new MGRubyArmor("RubyChestplate" , RUBYARMOR, 1, 1), "RubyChestplate");
GameRegistry.registerItem(RubyLeggings = new MGRubyArmor("RubyLeggings" , RUBYARMOR, 2, 2), "RubyLeggings");
GameRegistry.registerItem(RubyBoots = new MGRubyArmor("RubyBoots" , RUBYARMOR, 3, 3), "RubyBoots");
GameRegistry.registerItem(EmeraldHelmet = new MGEmeraldArmor("EmeraldHelmet" , EMERALDARMOR, 1, 0), "EmeraldHelmet");
GameRegistry.registerItem(EmeraldChestplate = new MGEmeraldArmor("EmeraldChestplate" , EMERALDARMOR, 1, 1), "EmeraldChestplate");
GameRegistry.registerItem(EmeraldLeggings = new MGEmeraldArmor("EmeraldLeggings" , EMERALDARMOR, 2, 2), "EmeraldLeggings");
GameRegistry.registerItem(EmeraldBoots = new MGEmeraldArmor("EmeraldBoots" , EMERALDARMOR, 3, 3), "EmeraldBoots");
GameRegistry.registerItem(SeedFinder = new MGSeedFinder("SeedFinder" , SEEDFINDER), "SeedFinder");
//Food
GameRegistry.registerItem(PitaBread = new MGItemFood("PitaBread", 3 , 0.1F, false).setPotionEffect(Potion.regeneration.id, 10, 3, 0.7F), "PitaBread");
GameRegistry.registerItem(StrawBerryFood = new MGItemFood("StrawberryFood",2,1.4F, false),"StrawberryFood");
GameRegistry.registerItem(TomatoFood = new MGItemFood("TomatoFood",2,0.4F, false),"TomatoFood");
GameRegistry.registerItem(BeetFood = new MGItemFood("BeetFood",2,0.8F, true),"BeetFood");
GameRegistry.registerItem(LettuceFood = new MGItemFood("LettuceFood",2,0.8F, true),"LettuceFood");
GameRegistry.registerItem(PickleFood = new MGItemFood("PickleFood",2,0.8F, true),"PickleFood");
//Crops
GameRegistry.registerItem(StrawBerryseeds = new MGItemSeeds(MGBlocks.StrawBerryPlant, Blocks.farmland,"StrawBerrySeeds"), "StrawBerrySeeds");
GameRegistry.registerItem(TomatoSeeds = new MGItemSeeds(MGBlocks.TomatoPlant, Blocks.farmland,"TomatoSeeds"), "TomatoSeeds");
GameRegistry.registerItem(BeetSeeds = new MGItemSeeds(MGBlocks.BeetPlant, Blocks.farmland,"BeetSeeds"), "BeetSeeds");
GameRegistry.registerItem(LettuceSeeds = new MGItemSeeds(MGBlocks.LettucePlant, Blocks.farmland,"LettuceSeeds"), "LettuceSeeds");
GameRegistry.registerItem(PickleSeeds = new MGItemSeeds(MGBlocks.PicklePlant, Blocks.farmland,"PickleSeeds"), "PickleSeeds");
//Ingots
GameRegistry.registerItem(copperIngot = new MGItem("copperIngot"),"copperIngot");
GameRegistry.registerItem(Ruby = new MGItem("Ruby"),"Ruby");
GameRegistry.registerItem(NickelIngot = new MGItem("NickelIngot"),"NickelIngot");
GameRegistry.registerItem(Sapphire = new MGItem("Sapphire"),"Sapphire");
GameRegistry.registerItem(TitaniumIngot = new MGItem("TitaniumIngot"), "TitaniumIngot");
GameRegistry.registerItem(Peridot = new MGItem("Peridot"),"Peridot");
GameRegistry.registerItem(PlutoniumIngot = new MGItem("PlutoniumIngot"),"PlutoniumIngot");
GameRegistry.registerItem(Amyethyst = new MGItem("Amyethyst"), "Amyethyst");
GameRegistry.registerItem(RedDiamond = new MGItem("RedDiamond"), "RedDiamond");
GameRegistry.registerItem(GreenDiamond = new MGItem("GreenDiamond"),"GreenDiamond");
GameRegistry.registerItem(YellowDiamond = new MGItem("YellowDiamond"),"YellowDiamond");
//Other
GameRegistry.registerItem(Energon = new MGItem("Energon"),"Energon");
What do you mean in what class... In the class where you call initItems() of course?
Also, instead of following tutorials that are incomplete and that you get errors off of, you should really consider actually learning Java and then starting to mod. But nobody ever does that.
---- Minecraft Crash Report ----
// Don't be sad. I'll do better next time, I promise!
Time: 5/3/16 6:04 PM
Description: Exception in server tick loop
java.lang.NullPointerException: Exception in server tick loop
at com.mogames.mod.handler.MGDropHandler.addBlockDrop(MGDropHandler.java:34)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_7_MGDropHandler_addBlockDrop_HarvestDropsEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:189)
at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:626)
at net.minecraft.block.Block.dropBlockAsItem(Block.java:615)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:169)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:132)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:128)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:132)
at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:499)
at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:476)
at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:290)
at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:729)
at net.minecraft.world.World.setBlockState(World.java:367)
at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152)
at net.minecraft.world.World.forceBlockUpdateTick(World.java:2836)
at net.minecraft.world.gen.feature.WorldGenLiquids.generate(WorldGenLiquids.java:82)
at net.minecraft.world.biome.BiomeDecorator.genDecorations(BiomeDecorator.java:400)
at net.minecraft.world.biome.BiomeDecorator.decorate(BiomeDecorator.java:136)
at net.minecraft.world.biome.BiomeGenBase.decorate(BiomeGenBase.java:404)
at net.minecraft.world.biome.BiomeGenJungle.decorate(BiomeGenJungle.java:71)
at net.minecraft.world.gen.ChunkProviderGenerate.populate(ChunkProviderGenerate.java:473)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:283)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1156)
at net.minecraft.world.gen.ChunkProviderServer.originalLoadChunk(ChunkProviderServer.java:187)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:129)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:99)
at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:347)
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:110)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:127)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:508)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.8.9
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_91, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 735193352 bytes (701 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 1, tcache: 1, allocated: 12, tallocated: 94
FML: MCP 9.19 Powered by Forge 11.15.1.1722 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
UCHIJAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
UCHIJAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1722.jar)
UCHIJAA Forge{11.15.1.1722} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1722.jar)
UCHIJAA MG{v 0.1 Beta} [mogames Mod] (bin)
Loaded coremods (and transformers):
GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
Profiler Position: N/A (disabled)
Player Count: 0 / 8; []
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
Here is the Drop Class
package com.mogames.mod.handler;
import java.util.Random;
import com.mogames.mod.items.MGItems;
import com.mogames.mod.items.tools.MGSeedFinder;
import net.minecraft.block.BlockOldLog;
import net.minecraft.block.BlockPlanks;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class MGDropHandler {
@SubscribeEvent
public void AddEntityDrop(LivingDropsEvent event){
if(event.entity instanceof EntityZombie){
ItemStack itemstack = new ItemStack(MGItems.TomatoSeeds , 1);
event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, itemstack));
}
}
@SubscribeEvent
public void addBlockDrop (HarvestDropsEvent event) {
if (event.state.getBlock() == Blocks.tallgrass) {
Random rand = new Random();
ItemStack holding = event.harvester.inventory.getStackInSlot(event.harvester.inventory.currentItem);
if (holding != null && holding.getItem() instanceof MGSeedFinder) {
event.drops.clear();
event.drops.add(new ItemStack(MGItems.TomatoSeeds, rand.nextInt(2)));
event.drops.add(new ItemStack(MGItems.StrawBerryseeds, rand.nextInt(2)));
event.drops.add(new ItemStack(MGItems.LettuceSeeds, rand.nextInt(2)));
event.drops.add(new ItemStack(MGItems.BeetSeeds, rand.nextInt(2)));
}
}
}
}
Okay. First of all, please provide details. How are we supposed to help you if you're not even saying what goes wrong or even what you're trying to do.
Also, please read the stacktrace:
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
I edited the Drop class to make my seeds drop from tall-Grass with my SeedFnder tool, But I started MineCraft made a new world and then it crashed.
You're using a null object in MGDropHandler line 34.
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
what is the null object, I looked over the drop class?
It's StrawBerryseeds in line 34.
Is it spelled right that way or should it state StrawBerrySeeds?
Also the random method can return 0, which results in an ItemStack with a StackSize of 0, which turns the whole object to null.
it is StrawBerryseeds, and you can i fix the null stacktrace
prevent the random from returning a value of 0.
how do i do that, could you give me code?
That cannot be the issue, as an ArrayList will let you add null without problem.
Sora, show us the MGItems class.
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
You simply add 1 (or any positive number) to the result of Random#nextInt
We can't give you code, because we're not the ones writing your mod. If you don't understand what we mean, you might not know what you're doing -- and if that's the case, it will be very hard to help you until you understand Java better.
if you are talking about nextInt in the drop class, i have 4 for the next inr
Are you sure you have initialized MGItems.StrawBerryseeds? Check. Then double-check.
System.out.err("Nope");
Its regsitered
Show us MGItems please.
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
here is MGItems and the SeedFinder Class
MGItems
package com.mogames.mod.items;
import com.mogames.mod.MGGlobal;
import com.mogames.mod.blocks.MGBlocks;
import com.mogames.mod.items.Armor.MGEmeraldArmor;
import com.mogames.mod.items.Armor.MGNIGHTVIS;
import com.mogames.mod.items.Armor.MGRubyArmor;
import com.mogames.mod.items.crops.MGItemSeeds;
import com.mogames.mod.items.food.MGItemFood;
import com.mogames.mod.items.tools.MGEmeraldAxe;
import com.mogames.mod.items.tools.MGEmeraldHoe;
import com.mogames.mod.items.tools.MGEmeraldPickaxe;
import com.mogames.mod.items.tools.MGEmeraldSpade;
import com.mogames.mod.items.tools.MGEmeraldSword;
import com.mogames.mod.items.tools.MGRubyAxe;
import com.mogames.mod.items.tools.MGRubyHoe;
import com.mogames.mod.items.tools.MGRubyPickaxe;
import com.mogames.mod.items.tools.MGRubySpade;
import com.mogames.mod.items.tools.MGRubySword;
import com.mogames.mod.items.tools.MGSapphireAxe;
import com.mogames.mod.items.tools.MGSapphirePickaxe;
import com.mogames.mod.items.tools.MGSapphireSpade;
import com.mogames.mod.items.tools.MGSapphireSword;
import com.mogames.mod.items.tools.MGSappphireHoe;
import com.mogames.mod.items.tools.MGSeedFinder;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class MGItems {
//tools
public static ToolMaterial RUBYTOOLS = EnumHelper.addToolMaterial("RUBYTOOLS", 3, 1050, 12.0F, 4.0F, 20);
public static ToolMaterial SAPPHIRETOOLS = EnumHelper.addToolMaterial("SAPPHIRETOOLS", 3, 1050, 11.0F, 3.5F, 20);
public static ToolMaterial EMERALDTOOLS = EnumHelper.addToolMaterial("EMERALDTOOLS", 4, 1600, 15.0F, 4.5F, 25);
public static ToolMaterial SEEDFINDER = EnumHelper.addToolMaterial("SEEDFINDER", 2, 400, 10.0F, 5.0F, 25);
//Armor
public static ArmorMaterial RUBYARMOR = EnumHelper.addArmorMaterial("RUBYARMOR", MGGlobal.Mod_ID + ":" + "ruby",20 , new int[]{2,6,5,4}, 25);
public static ArmorMaterial EMERALDARMOR = EnumHelper.addArmorMaterial("EMERALDARMOR", MGGlobal.Mod_ID + ":" + "emerald",20 , new int[]{2,7,6,4}, 25);
public static ArmorMaterial NIGHTVIS = EnumHelper.addArmorMaterial("NightVis", MGGlobal.Mod_ID + ":" + "NightVis",20 , new int[]{1,0,0,0}, 25);
public static Item RubyHelmet;
public static Item RubyChestplate;
public static Item RubyLeggings;
public static Item RubyBoots;
public static Item EmeraldHelmet;
public static Item EmeraldChestplate;
public static Item EmeraldLeggings;
public static Item EmeraldBoots;
public static Item RubyPickaxe;
public static Item RubyAxe;
public static Item RubyHoe;
public static Item RubySpade;
public static Item RubySword;
public static Item SapphirePickaxe;
public static Item SapphireAxe;
public static Item SapphireHoe;
public static Item SapphireSpade;
public static Item SapphireSword;
public static Item EmeraldPickaxe;
public static Item EmeraldAxe;
public static Item EmeraldHoe;
public static Item EmeraldSpade;
public static Item EmeraldSword;
public static Item SeedFinder;
//Food
public static Item PitaBread;
public static Item StrawBerryFood;
public static Item TomatoFood;
public static Item BeetFood;
public static Item LettuceFood;
public static Item PickleFood;
//Crops
public static Item StrawBerryseeds;
public static Item TomatoSeeds;
public static Item BeetSeeds;
public static Item LettuceSeeds;
public static Item PickleSeeds;
//Ingot
public static Item copperIngot;
public static Item Ruby;
public static Item Sapphire;
public static Item NickelIngot;
public static Item TitaniumIngot;
public static Item Peridot;
public static Item PlutoniumIngot;
public static Item Amyethyst;
public static Item RedDiamond;
public static Item YellowDiamond;
public static Item GreenDiamond;
//Other
public static Item Energon;
public static Item NightVis;
public static void initItems() {
//tools
GameRegistry.registerItem(RubyPickaxe = new MGRubyPickaxe("RubyPickaxe", RUBYTOOLS),"RubyPickaxe");
GameRegistry.registerItem(RubyAxe = new MGRubyAxe("RubyAxe", RUBYTOOLS), "RubyAxe");
GameRegistry.registerItem(RubyHoe = new MGRubyHoe("RubyHoe", RUBYTOOLS),"RubyHoe");
GameRegistry.registerItem(RubySpade = new MGRubySpade("RubySpade", RUBYTOOLS), "RubySpade");
GameRegistry.registerItem(RubySword = new MGRubySword("RubySword", RUBYTOOLS),"RubySword");
GameRegistry.registerItem(SapphirePickaxe = new MGSapphirePickaxe("SapphirePickaxe", SAPPHIRETOOLS),"SapphirePickaxe");
GameRegistry.registerItem(SapphireAxe = new MGSapphireAxe("SapphireAxe", SAPPHIRETOOLS), "SapphireAxe");
GameRegistry.registerItem(SapphireHoe = new MGSappphireHoe("SapphireHoe", SAPPHIRETOOLS),"SapphireHoe");
GameRegistry.registerItem(SapphireSpade = new MGSapphireSpade("SapphireSpade", SAPPHIRETOOLS), "SapphireSpade");
GameRegistry.registerItem(SapphireSword = new MGSapphireSword("SapphireSword", SAPPHIRETOOLS),"SapphireSword");
GameRegistry.registerItem(EmeraldPickaxe = new MGEmeraldPickaxe("EmeraldPickaxe", EMERALDTOOLS),"EmeraldPickaxe");
GameRegistry.registerItem(EmeraldAxe = new MGEmeraldAxe("EmeraldAxe", EMERALDTOOLS), "EmeraldAxe");
GameRegistry.registerItem(EmeraldHoe = new MGEmeraldHoe("EmeraldHoe", EMERALDTOOLS),"EmeraldHoe");
GameRegistry.registerItem(EmeraldSpade = new MGEmeraldSpade("EmeraldSpade", EMERALDTOOLS), "EmeraldSpade");
GameRegistry.registerItem(EmeraldSword = new MGEmeraldSword("EmeraldSword", EMERALDTOOLS),"EmeraldSword");
GameRegistry.registerItem(NightVis = new MGNIGHTVIS("NightVis", NIGHTVIS, 1, 0),"NightVis");
//Armor
GameRegistry.registerItem(RubyHelmet = new MGRubyArmor("RubyHelmet" , RUBYARMOR, 1, 0), "RubyHelmet");
GameRegistry.registerItem(RubyChestplate = new MGRubyArmor("RubyChestplate" , RUBYARMOR, 1, 1), "RubyChestplate");
GameRegistry.registerItem(RubyLeggings = new MGRubyArmor("RubyLeggings" , RUBYARMOR, 2, 2), "RubyLeggings");
GameRegistry.registerItem(RubyBoots = new MGRubyArmor("RubyBoots" , RUBYARMOR, 3, 3), "RubyBoots");
GameRegistry.registerItem(EmeraldHelmet = new MGEmeraldArmor("EmeraldHelmet" , EMERALDARMOR, 1, 0), "EmeraldHelmet");
GameRegistry.registerItem(EmeraldChestplate = new MGEmeraldArmor("EmeraldChestplate" , EMERALDARMOR, 1, 1), "EmeraldChestplate");
GameRegistry.registerItem(EmeraldLeggings = new MGEmeraldArmor("EmeraldLeggings" , EMERALDARMOR, 2, 2), "EmeraldLeggings");
GameRegistry.registerItem(EmeraldBoots = new MGEmeraldArmor("EmeraldBoots" , EMERALDARMOR, 3, 3), "EmeraldBoots");
GameRegistry.registerItem(SeedFinder = new MGSeedFinder("SeedFinder" , SEEDFINDER), "SeedFinder");
//Food
GameRegistry.registerItem(PitaBread = new MGItemFood("PitaBread", 3 , 0.1F, false).setPotionEffect(Potion.regeneration.id, 10, 3, 0.7F), "PitaBread");
GameRegistry.registerItem(StrawBerryFood = new MGItemFood("StrawberryFood",2,1.4F, false),"StrawberryFood");
GameRegistry.registerItem(TomatoFood = new MGItemFood("TomatoFood",2,0.4F, false),"TomatoFood");
GameRegistry.registerItem(BeetFood = new MGItemFood("BeetFood",2,0.8F, true),"BeetFood");
GameRegistry.registerItem(LettuceFood = new MGItemFood("LettuceFood",2,0.8F, true),"LettuceFood");
GameRegistry.registerItem(PickleFood = new MGItemFood("PickleFood",2,0.8F, true),"PickleFood");
//Crops
GameRegistry.registerItem(StrawBerryseeds = new MGItemSeeds(MGBlocks.StrawBerryPlant, Blocks.farmland,"StrawBerrySeeds"), "StrawBerrySeeds");
GameRegistry.registerItem(TomatoSeeds = new MGItemSeeds(MGBlocks.TomatoPlant, Blocks.farmland,"TomatoSeeds"), "TomatoSeeds");
GameRegistry.registerItem(BeetSeeds = new MGItemSeeds(MGBlocks.BeetPlant, Blocks.farmland,"BeetSeeds"), "BeetSeeds");
GameRegistry.registerItem(LettuceSeeds = new MGItemSeeds(MGBlocks.LettucePlant, Blocks.farmland,"LettuceSeeds"), "LettuceSeeds");
GameRegistry.registerItem(PickleSeeds = new MGItemSeeds(MGBlocks.PicklePlant, Blocks.farmland,"PickleSeeds"), "PickleSeeds");
//Ingots
GameRegistry.registerItem(copperIngot = new MGItem("copperIngot"),"copperIngot");
GameRegistry.registerItem(Ruby = new MGItem("Ruby"),"Ruby");
GameRegistry.registerItem(NickelIngot = new MGItem("NickelIngot"),"NickelIngot");
GameRegistry.registerItem(Sapphire = new MGItem("Sapphire"),"Sapphire");
GameRegistry.registerItem(TitaniumIngot = new MGItem("TitaniumIngot"), "TitaniumIngot");
GameRegistry.registerItem(Peridot = new MGItem("Peridot"),"Peridot");
GameRegistry.registerItem(PlutoniumIngot = new MGItem("PlutoniumIngot"),"PlutoniumIngot");
GameRegistry.registerItem(Amyethyst = new MGItem("Amyethyst"), "Amyethyst");
GameRegistry.registerItem(RedDiamond = new MGItem("RedDiamond"), "RedDiamond");
GameRegistry.registerItem(GreenDiamond = new MGItem("GreenDiamond"),"GreenDiamond");
GameRegistry.registerItem(YellowDiamond = new MGItem("YellowDiamond"),"YellowDiamond");
//Other
GameRegistry.registerItem(Energon = new MGItem("Energon"),"Energon");
}
}
SeedFinder Class
package com.mogames.mod.items.tools;
import com.mogames.mod.MGGlobal;
import net.minecraft.item.Item;
import net.minecraft.item.ItemShears;
import net.minecraft.item.Item.ToolMaterial;
public class MGSeedFinder extends ItemShears {
public MGSeedFinder(String unlocalizedName , ToolMaterial material) {
super();
this.setUnlocalizedName(unlocalizedName);
this.setCreativeTab(MGGlobal.MGToolsWeapons);
}
}
Uhm.. seems like the item is actually correctly instantiated. Put a breakpoint in MGDropHandler and find out what object is null.
Actually, please make sure initItems() was called before creating and registering the EventHandler
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
in what class and it all worked fine before the drop class
FYI: I use the tutorials of Neal Gaming
What do you mean in what class... In the class where you call initItems() of course?
Also, instead of following tutorials that are incomplete and that you get errors off of, you should really consider actually learning Java and then starting to mod. But nobody ever does that.
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!