Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey, I'm having problems with my mod that simply adds a few items with crafting recipes and has vanilla mobs drop them.

 

My crash report is as follows:

 

 

---- Minecraft Crash Report ----

// Daisy, daisy...

 

Time: 11/03/14 14:17

Description: Exception in server tick loop

 

java.lang.NullPointerException: Exception in server tick loop

at net.minecraftforge.common.ForgeChunkManager.saveWorld(ForgeChunkManager.java:819)

at net.minecraftforge.common.ForgeInternalHandler.onDimensionSave(ForgeInternalHandler.java:70)

at cpw.mods.fml.common.eventhandler.ASMEventHandler_2_ForgeInternalHandler_onDimensionSave_Save.invoke(.dynamic)

at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)

at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)

at net.minecraft.world.WorldServer.func_73044_a(WorldServer.java:841)

at net.minecraft.server.MinecraftServer.func_71267_a(MinecraftServer.java:346)

at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:591)

at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:454)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:706)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.7.0_51, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 142504552 bytes (135 MB) / 487063552 bytes (464 MB) up to 954728448 bytes (910 MB)

JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G

AABB Pool Size: 576 (32256 bytes; 0 MB) allocated, 162 (9072 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

FML: MCP v9.01-pre FML v7.2.128.1040 Minecraft Forge 10.12.0.1040 Optifine OptiFine_1.7.2_HD_U_B2 4 mods loaded, 4 mods active

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.2.128.1040} [Forge Mod Loader] (forge-1.7.2-10.12.0.1040.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.12.0.1040} [Minecraft Forge] (forge-1.7.2-10.12.0.1040.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

haggismod{1.7.2-1.3.0} [Haggis Mod] (haggismod-1.7.2-1.3.0.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Profiler Position: N/A (disabled)

Vec3 Pool Size: 220 (12320 bytes; 0 MB) allocated, 45 (2520 bytes; 0 MB) used

Player Count: 1 / 8; [EntityPlayerMP['UltimateDillon'/237, l='Haggis Test', x=87.26, y=68.00, z=267.48]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

 

 

 

This happens whenever I try to play in a Single Player world, but not on a Server.

 

If I could have some help on how to solve this, that would be great as the crash report doesn't list any of my classes or processes as creating the problem. Maybe I'm missing a class that handles this stuff?

 

EDIT: I'm aware the problem occurs when the game tries to save the world chunks, but I have no idea how to resolve it.

Something in your code is null I think can I see some source?

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

  • Author

Something in your code is null I think can I see some source?

 

HaggisMain.java

 

 

package ultimatedillon.haggis;

 

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.ItemFood;

import net.minecraft.item.ItemStack;

import net.minecraft.potion.Potion;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler; // used in 1.6.2

//import cpw.mods.fml.common.Mod.PreInit;    // used in 1.5.2

//import cpw.mods.fml.common.Mod.Init;      // used in 1.5.2

//import cpw.mods.fml.common.Mod.PostInit;  // used in 1.5.2

import cpw.mods.fml.common.Mod.Instance;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPostInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.registry.GameRegistry;

//import cpw.mods.fml.common.network.NetworkMod; // not used in 1.7

 

@Mod(modid= HaggisMain.modid, name="Haggis Mod", version="1.7.2-1.3.0")

//@NetworkMod(clientSideRequired=true) // not used in 1.7

public class HaggisMain {

 

public static final String modid = "haggismod";

 

        // The instance of your mod that Forge uses.

        @Instance(value = "haggismod")

        public static HaggisMain instance;

       

        // Says where the client and server 'proxy' code is loaded.

        @SidedProxy(clientSide="ultimatedillon.haggis.client.ClientProxy", serverSide="ultimatedillon.haggis.CommonProxy")

        public static CommonProxy proxy;

       

        public static ItemFood raw_haggis = new ItemFood(3, 0.3F, false);

        public static ItemFood cooked_haggis = new ItemFood(8, 0.8F, false);

        public static ItemFood golden_haggis = new ItemFood(20, 1.0F, false);

       

        @EventHandler // used in 1.6.2

        //@PreInit    // used in 1.5.2

        public void preInit(FMLPreInitializationEvent event) {

                 

          raw_haggis.setTextureName("haggismod:raw_haggis")

          .setUnlocalizedName("raw_haggis")

          .setMaxStackSize(64)

          .setCreativeTab(CreativeTabs.tabFood);

         

          cooked_haggis.setTextureName("haggismod:cooked_haggis")

          .setUnlocalizedName("raw_haggis")

          .setMaxStackSize(64)

          .setCreativeTab(CreativeTabs.tabFood);

         

          golden_haggis.setTextureName("haggismod:golden_haggis")

          .setUnlocalizedName("golden_haggis")

          .setMaxStackSize(64)

          .setCreativeTab(CreativeTabs.tabFood);

         

          raw_haggis.setPotionEffect(Potion.hunger.id, 30, 0, 0.3F);

          golden_haggis.setPotionEffect(Potion.regeneration.id, 8, 0, 1.0F);

         

          GameRegistry.registerItem(raw_haggis, "raw_haggis");

          GameRegistry.registerItem(cooked_haggis, "cooked_haggis");

          GameRegistry.registerItem(golden_haggis, "golden_haggis");

         

          GameRegistry.addRecipe(new ItemStack(golden_haggis), new Object[] { "XXX", "XHX", "XXX", 'X', Items.gold_nugget, 'H', cooked_haggis });

          GameRegistry.addSmelting(raw_haggis, new ItemStack(cooked_haggis), 0.35F);

         

        }

       

        @EventHandler // used in 1.6.2

        //@Init      // used in 1.5.2

        public void load(FMLInitializationEvent event) {

                proxy.registerRenderers();           

        }

       

        @EventHandler // used in 1.6.2

        //@PostInit  // used in 1.5.2

        public void postInit(FMLPostInitializationEvent event) {

                // Stub Method

        }

       

}

 

 

 

CustomDrops.java

 

 

package ultimatedillon.haggis;

 

import net.minecraft.entity.passive.EntitySheep;

import net.minecraftforge.event.entity.living.LivingDropsEvent;

 

public class CustomDrops extends HaggisMain

{

public static double rand;

 

public void onEntityDrop(LivingDropsEvent event)

{

    if (event.entityLiving instanceof EntitySheep)

    {

      event.entityLiving.dropItem(HaggisMain.raw_haggis, 1);

     

      rand = Math.random();

      if (rand < 0.3D) {

        event.entityLiving.dropItem(HaggisMain.raw_haggis, 1);

      }

    }

}

}

 

 

Looks normal too me only that you should register the food in the preinit.

 

Do your proxy's have any code?

or is there anything else that could create an error.

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

Can you provide the full log? (ForgeModLoader-client-0.log / ForgeModLoader-server-0.log)

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

  • Author

Looks normal too me only that you should register the food in the preinit.

 

Do your proxy's have any code?

or is there anything else that could create an error.

 

The food is registered in the PreInit and the proxies are the same as they've always been:

CommonProxy.java

 

 

package ultimatedillon.haggis;

 

public class CommonProxy {

 

    // Client stuff

    public void registerRenderers() {

            // Nothing here as the server doesn't render graphics or entities!

    }

}

 

 

 

ClientProxy.java

 

 

package ultimatedillon.haggis.client;

 

import ultimatedillon.haggis.CommonProxy;

import net.minecraftforge.client.MinecraftForgeClient;

 

public class ClientProxy extends CommonProxy {

       

        @Override

        public void registerRenderers() {

                // This is for rendering entities and so forth later on

        }

       

}

 

 

 

The only thing I can think of is the fact that my custom drops don't work even though I've now added this line to the PreInit in my main class:

MinecraftForge.EVENT_BUS.register(new CustomDrops());

  • Author

EDIT:

MinecraftForge.EVENT_BUS.register(new CustomDrops());

Moved this into the load method and still doesn't make the mob drop the items.

 

you need to put @SubscribeEvent above this line: public void onEntityDrop(LivingDropsEvent event)

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

  • Author

you need to put @SubscribeEvent above this line: public void onEntityDrop(LivingDropsEvent event)

 

Thanks, that fixed the problem of the mob drops, but I still have the crashes.

Sorry that I can't provide a solution but I can provide a quick tip: move the registration of your crafting recipes from the preInit-method to the init-method. It's nothing severe but more common to register advance stuff (things that require items or such already registered) in the init method.

  • Author

Sorry that I can't provide a solution but I can provide a quick tip: move the registration of your crafting recipes from the preInit-method to the init-method. It's nothing severe but more common to register advance stuff (things that require items or such already registered) in the init method.

 

Do you mean in:

@EventHandler // used in 1.6.2
//@Init       // used in 1.5.2
public void load(FMLInitializationEvent event) {
        proxy.registerRenderers();
}

 

I was registering my stuff in there at first but it didn't actually work until I moved it to PreInit

I just don't advice registering all your items in your main class file this is how I do it:

@EventHandler
public void preInit(FMLPreInitializationEvent event){
	BlocksItems.InitItems();
	BlocksItems.InitBlocks();
	BlocksItems.WorldGen();
	Config.InitRecipes();
	Config.registerMolecules();
	Config.registerSamples();
	Config.registerMineralProps();
	Config.registerTileEntity();
        proxy.registerRenderers();
}

 

and then in my blockitems file(sorry it's a mess i need to clean it up more)

public class BlocksItems {
//items
public static Item Emptyjar;
public static Item Sample;
public static Item Mineral;

//blocks
public static Block OrePlutonium;
public static Block Evaporite;
public static Block BlockSlowHeatConductant;
public static Block BlockMediumHeatConductant;
public static Block BlockFastHeatConductant;
//	public static Block ResearchTableIdle;
//	public static Block ResearchTableActive;

public static void WorldGen(){
	GameRegistry.registerWorldGenerator(new WorldGen(), 1);

}

public static void InitItems(){
	Emptyjar = new ItemEmptyjar().setUnlocalizedName("Emptyjar").setCreativeTab(MolecularScience.MItems);
        Sample = new ItemSample().setUnlocalizedName("sample");
        Mineral = new ItemMineral().setUnlocalizedName("Mineral");
        
        GameRegistry.registerItem(Emptyjar,"Emptyjar");
        GameRegistry.registerItem(Sample,"Sample");
        GameRegistry.registerItem(Mineral,"Mineral");
}

public static void InitBlocks(){
        OrePlutonium = new BlockOre(Material.rock, 2).setHardness(3.0F).setBlockName("Plutoniumore");
        Evaporite = new BlockEvaporite(Material.rock).setHardness(3.0F).setBlockName("Evaporite");
        BlockSlowHeatConductant = new BlockHeatConductant(Material.rock, 50).setHardness(3.0F).setBlockName("BlockSlowHeatConductant");
        BlockMediumHeatConductant = new BlockHeatConductant(Material.rock, 25).setHardness(3.0F).setBlockName("BlockMediumHeatConductant");
        BlockFastHeatConductant = new BlockHeatConductant(Material.rock, 5).setHardness(3.0F).setBlockName("BlockFastHeatConductant");
//        ResearchTableIdle = new ResearchTable(false).setBlockName("ResearchTableIdle").setCreativeTab(MolecularScience.Blocks);
//        ResearchTableActive = new ResearchTable(true).setBlockName("ResearchTableActive");
        
        GameRegistry.registerBlock(OrePlutonium, "Plutoniumore");
        GameRegistry.registerBlock(Evaporite, "Evaporite");
        GameRegistry.registerBlock(BlockSlowHeatConductant, "BlockSlowHeatConductant");
        GameRegistry.registerBlock(BlockMediumHeatConductant, "BlockMediumHeatConductant");
        GameRegistry.registerBlock(BlockFastHeatConductant, "BlockFastHeatConductant");
//        GameRegistry.registerBlock(ResearchTableIdle, "ResearchTableIdle");
//        GameRegistry.registerBlock(ResearchTableActive, "ResearchTableActive");
}
}

 

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

  • Author

I just don't advice registering all your items in your main class file this is how I do it:

@EventHandler
public void preInit(FMLPreInitializationEvent event){
	BlocksItems.InitItems();
	BlocksItems.InitBlocks();
	BlocksItems.WorldGen();
	Config.InitRecipes();
	Config.registerMolecules();
	Config.registerSamples();
	Config.registerMineralProps();
	Config.registerTileEntity();
        proxy.registerRenderers();
}

 

and then in my blockitems file(sorry it's a mess i need to clean it up more)

public class BlocksItems {
//items
public static Item Emptyjar;
public static Item Sample;
public static Item Mineral;

//blocks
public static Block OrePlutonium;
public static Block Evaporite;
public static Block BlockSlowHeatConductant;
public static Block BlockMediumHeatConductant;
public static Block BlockFastHeatConductant;
//	public static Block ResearchTableIdle;
//	public static Block ResearchTableActive;

public static void WorldGen(){
	GameRegistry.registerWorldGenerator(new WorldGen(), 1);

}

public static void InitItems(){
	Emptyjar = new ItemEmptyjar().setUnlocalizedName("Emptyjar").setCreativeTab(MolecularScience.MItems);
        Sample = new ItemSample().setUnlocalizedName("sample");
        Mineral = new ItemMineral().setUnlocalizedName("Mineral");
        
        GameRegistry.registerItem(Emptyjar,"Emptyjar");
        GameRegistry.registerItem(Sample,"Sample");
        GameRegistry.registerItem(Mineral,"Mineral");
}

public static void InitBlocks(){
        OrePlutonium = new BlockOre(Material.rock, 2).setHardness(3.0F).setBlockName("Plutoniumore");
        Evaporite = new BlockEvaporite(Material.rock).setHardness(3.0F).setBlockName("Evaporite");
        BlockSlowHeatConductant = new BlockHeatConductant(Material.rock, 50).setHardness(3.0F).setBlockName("BlockSlowHeatConductant");
        BlockMediumHeatConductant = new BlockHeatConductant(Material.rock, 25).setHardness(3.0F).setBlockName("BlockMediumHeatConductant");
        BlockFastHeatConductant = new BlockHeatConductant(Material.rock, 5).setHardness(3.0F).setBlockName("BlockFastHeatConductant");
//        ResearchTableIdle = new ResearchTable(false).setBlockName("ResearchTableIdle").setCreativeTab(MolecularScience.Blocks);
//        ResearchTableActive = new ResearchTable(true).setBlockName("ResearchTableActive");
        
        GameRegistry.registerBlock(OrePlutonium, "Plutoniumore");
        GameRegistry.registerBlock(Evaporite, "Evaporite");
        GameRegistry.registerBlock(BlockSlowHeatConductant, "BlockSlowHeatConductant");
        GameRegistry.registerBlock(BlockMediumHeatConductant, "BlockMediumHeatConductant");
        GameRegistry.registerBlock(BlockFastHeatConductant, "BlockFastHeatConductant");
//        GameRegistry.registerBlock(ResearchTableIdle, "ResearchTableIdle");
//        GameRegistry.registerBlock(ResearchTableActive, "ResearchTableActive");
}
}

 

You mean set up and register my items in a class and then just call it in the PreInit method?

 

I originally did something like that but decided just to do it in less classes. Was that a bad decision? xD

Nah i just think it looks better when you use different classes :)

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

  • Author

Nah i just think it looks better when you use different classes :)

:P

Do you know of a way I can prevent my stuff showing up in creative or being spawned in on servers?

No but why would you want that?

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

  • Author

No but why would you want that?

 

It bothers me that I can almost spawn in items on a normal bukkit server but nobody can see them and if i try to click or take them out of the inventory GUI they disappear. It just doesn't seem neat or practical. I also don't know many servers that will want to use it as a server mod.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.