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

I just started recoding my mod to forge, but at the first test install, i got a NullPointerException on login using MultiMC

crash report:

 

 

- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 455069248 bytes (433 MB) / 514523136 bytes (490 MB) up to 954466304 bytes (910 MB)
- JVM Flags: 2 total; -Xmx1024m -Xms512m
- LWJGL: 2.8.3
- OpenGL: Intel(R) G45/G43 Express Chipset GL version 2.1.0 - Build 8.15.10.2555, Intel
- Is Modded: Definitely; 'forge,fml'
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)

java.lang.NullPointerException
at cpw.mods.fml.common.FMLModContainer.getName(FMLModContainer.java:105)
at cpw.mods.fml.common.Loader.sortModList(Loader.java:236)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:416)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:192)
at net.minecraft.client.Minecraft.a(Minecraft.java:402)
at net.minecraft.client.Minecraft.run(Minecraft.java:734)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT c6e8f06b ----------

 

 

 

I am using forge #193

 

here is the the source:

 

 

Trapped Cake.java

package nb.cake;

import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import java.util.logging.Level;
import net.minecraft.src.Block;
import net.minecraftforge.common.Configuration;
import net.minecraft.src.ItemStack;




@Mod(modid = "trappedcake", name = "Trapped Cakes", version = "0.1")
public class TrappedCake {
    
    public static BlockExplodingCake explodingCake;
    private int id1;
    
    @PreInit
    public void configure(FMLPreInitializationEvent event) {
        event.getModMetadata().version = "0.1";
        Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
        try {
            cfg.load();
            id1 = cfg.getOrCreateBlockIdProperty("explodingCake", 255).getInt(255);
        } catch(Exception e) {
            FMLLog.log(Level.SEVERE, e, "Trapped Cakes could not load it's configuration.");
        } finally {
            cfg.save();
        }
        
    }
    
    @Init
    public void load() {
        explodingCake = new BlockExplodingCake(id1);
        GameRegistry.registerBlock(explodingCake);
        LanguageRegistry.instance().addStringLocalization("explodingCake.name", "Exploding Cake");
        GameRegistry.addShapelessRecipe(new ItemStack(explodingCake, 1), new Object[] {Block.cake, Block.tnt});
        
    }
    
}

BlockExplodingCake.java

package nb.cake;

import net.minecraft.src.BlockCake;
import net.minecraft.src.World;
import net.minecraft.src.EntityPlayer;
import java.util.ArrayList;
import net.minecraft.src.ItemStack;

public class BlockExplodingCake extends BlockCake {
    
    public BlockExplodingCake(int id) {
        super(id, 121);
        setHardness(0.5F);
        setStepSound(soundClothFootstep);
        setBlockName("explodingCake");
        disableStats();
        setRequiresSelfNotify();
    }

    @Override
    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
        //explosion code here
        return true;
    }

    @Override
    public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) {
        // explosion code here
    }
    
    @Override
    public void addCreativeItems(ArrayList itemlist) {
        itemlist.add(new ItemStack(this));
    }
    
}

 

 

 

I am not sure where the error is...

If you ever post errors, post the log files, not just what you get. Sometimes FML doesnt print the "real" crash report.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

  • Author

there isn't a .log anywhere. I'll try again in a day or so. I think MultiMC replaced my 1.3.2 jar with a 1.3.1 jar

You need an mcmod.info file, I had the same problem here until I added a mcmod.info file into the zip of the mod.

Make sure the

"modid": "NAME",

is right. If I'm not mistaken that is FML's mod list freaking out because it has no name.

mcmod.info

Please send me all the typo's you found, I'm from Belgium and I'm a little dyslectic and suck @ typing.

width=700 height=100http://dries007.net/banner.png[/img]

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.