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'm make a minecraft mod that adds in random stuff, but it keeps crashing!

 

Crash log:

---- Minecraft Crash Report ----

// I blame Dinnerbone.

 

Time: 5/16/14 10:58 PM

Description: Initializing game

 

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character

at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:203)

at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:229)

at com.CraigTheMailman.RandomMC.RandomMC.init(RandomMC.java:117)

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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)

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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)

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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:687)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:527)

at net.minecraft.client.Minecraft.run(Minecraft.java:815)

at net.minecraft.client.main.Main.main(SourceFile:103)

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:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

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

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

 

-- Head --

Stacktrace:

at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:203)

at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:229)

at com.CraigTheMailman.RandomMC.RandomMC.init(RandomMC.java:117)

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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)

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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)

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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:687)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:527)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:815)

at net.minecraft.client.main.Main.main(SourceFile:103)

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:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Windows Vista (amd64) version 6.0

Java Version: 1.8.0_05, Oracle Corporation

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

Memory: 949606768 bytes (905 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

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

FML: MCP v9.03 FML v7.2.196.1082 Minecraft Forge 10.12.1.1082 4 mods loaded, 4 mods active

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

FML{7.2.196.1082} [Forge Mod Loader] (forgeBin-1.7.2-10.12.1.1082.jar) Unloaded->Constructed->Pre-initialized->Initialized

Forge{10.12.1.1082} [Minecraft Forge] (forgeBin-1.7.2-10.12.1.1082.jar) Unloaded->Constructed->Pre-initialized->Initialized

RandomMC{1.0} [RandomMC] (bin) Unloaded->Constructed->Pre-initialized->Errored

Launched Version: 1.6

LWJGL: 2.9.0

OpenGL: Mobile Intel® 4 Series Express Chipset Family GL version 2.1.0 - Build 8.15.10.2302, Intel

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)

Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

Anisotropic Filtering: Off (1)

 

Code:

package com.CraigTheMailman.RandomMC;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;

import com.CraigTheMailman.RandomMC.Gen.ChocoGen;
import com.CraigTheMailman.RandomMC.Gen.RainbowGen;
import com.CraigTheMailman.RandomMC.blocks.ChocoOre;
import com.CraigTheMailman.RandomMC.blocks.RainbowOre;
import com.CraigTheMailman.RandomMC.food.FoodChocolate;
import com.CraigTheMailman.RandomMC.items.Ash;
import com.CraigTheMailman.RandomMC.items.FireCrystal;
import com.CraigTheMailman.RandomMC.items.FlameEmitter;
import com.CraigTheMailman.RandomMC.items.RainbowAxe;
import com.CraigTheMailman.RandomMC.items.RainbowDye;
import com.CraigTheMailman.RandomMC.items.RainbowIngot;
import com.CraigTheMailman.RandomMC.items.RainbowPick;
import com.CraigTheMailman.RandomMC.items.RainbowShovel;
import com.CraigTheMailman.RandomMC.items.RainbowSword;
import com.CraigTheMailman.RandomMC.items.SpellBk1;
import com.CraigTheMailman.RandomMC.lib.ProxyCommon;
import com.CraigTheMailman.RandomMC.lib.Refrences;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = Refrences.ModID, version = Refrences.Version)
public class RandomMC {

@SidedProxy(clientSide = Refrences.Client, 
		serverSide = Refrences.Common)
    public static ProxyCommon Proxy;

//Tools
public static ToolMaterial Rainbow = EnumHelper.addToolMaterial("Rainbow", 3, 10000, 23.0F, 6.0F, 20);

//Armor

//Items
public static Item FlameEmitter = new FlameEmitter(100006).setCreativeTab(RandomMC.tabRandom);
public static Item Ash = new Ash(100005).setCreativeTab(RandomMC.tabRandom);
public static Item FireCrystal = new FireCrystal(100004).setCreativeTab(RandomMC.tabRandom);
public static Item SpellBk1 = new SpellBk1(100003).setCreativeTab(RandomMC.tabRandom);
public static Item RainbowIngot = new RainbowIngot(100002).setCreativeTab(RandomMC.tabRandom);
public static Item RainbowDye = new RainbowDye(100001).setCreativeTab(RandomMC.tabRandom);
public static Item RainbowPick = new RainbowPick(Rainbow).setCreativeTab(RandomMC.tabRandom);
public static Item RainbowSword = new RainbowSword(Rainbow).setCreativeTab(RandomMC.tabRandom);
public static Item RainbowShovel = new RainbowShovel(Rainbow).setCreativeTab(RandomMC.tabRandom);
public static Item RainbowAxe = new RainbowAxe(Rainbow).setCreativeTab(RandomMC.tabRandom);
public static Item RainbowHoe = new RainbowHoe(Rainbow).setCreativeTab(RandomMC.tabRandom);


//Generation
public static RainbowGen RainbowGen = new RainbowGen();
public static ChocoGen ChocoGen = new ChocoGen();

//Blocks
public static final Block RainbowOre = new RainbowOre(Material.rock);
public static final Block ChocoOre = new ChocoOre(Material.rock);

public static CreativeTabs tabRandom = new tabRandom(CreativeTabs.getNextID(), "RandomMC");

//Food
public static Item Chocolate = new FoodChocolate(100000, 4, true).setCreativeTab(RandomMC.tabRandom);

@EventHandler
public void init(FMLInitializationEvent event)
{

	//Crafting
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
        	Items.flint_and_steel, Items.paper});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Items.book});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
			Items.flint_and_steel, Blocks.planks});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Items.wooden_hoe});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] { 
		Items.flint_and_steel, Items.wooden_pickaxe});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Items.wooden_sword});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Items.wooden_shovel});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Items.wooden_axe});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Blocks.log});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Blocks.log2});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Blocks.chest});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Blocks.crafting_table});
	GameRegistry.addShapedRecipe(new ItemStack(this.FireCrystal, 1), new Object[] {
		"XXX", "YYY", "YAY", 'X', Blocks.glass, 'Y', Items.ghast_tear, 'A', this.Ash});
	GameRegistry.addShapedRecipe(new ItemStack(FlameEmitter, 1), new Object[] {
		"X A", " XY", " YY", 'X', Blocks.iron_block, 'A', this.FireCrystal, 'Y', Items.iron_ingot});
	GameRegistry.addShapedRecipe(new ItemStack(this.SpellBk1, 1), new Object[] {
		"XYX", "YJY", "XYX", 'X', Blocks.tnt, 'Y', Blocks.redstone_torch, 'J', Items.book});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowDye, 1), new Object[] {
		"XXX", "XXX", "XXX", 'X', Items.dye});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowIngot, 1), new Object[] {
		"XXX", "XYX", "XXX", 'X', this.RainbowDye, 'Y', Items.iron_ingot});
	GameRegistry.addShapelessRecipe(new ItemStack(this.Ash, 1), new Object[] {
		Items.flint_and_steel, Blocks.bookshelf});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowPick, 1), new Object[] {
		"XXX", " Y ", " Y ", 'X', this.RainbowIngot, "Y", Items.stick});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowSword, 1), new Object[] {
		" X ", " X ", " Y ", 'X', this.RainbowIngot, "Y", Items.stick});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowShovel, 1), new Object[] {
		" X ", " Y ", " Y ", 'X', this.RainbowIngot, "Y", Items.stick});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowAxe, 1), new Object[] {
		"XX ", "XY ", " Y ", 'X', this.RainbowIngot, "Y", Items.stick});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowAxe, 1), new Object[] {
		" XX", " YX", " Y ", 'X', this.RainbowIngot, "Y", Items.stick});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowHoe, 1), new Object[] {
		" XX", " Y ", " Y ", 'X', this.RainbowIngot, "Y", Items.stick});
	GameRegistry.addShapedRecipe(new ItemStack(this.RainbowHoe, 1), new Object[] {
		"XX ", " Y ", " Y ", 'X', this.RainbowIngot, "Y", Items.stick});

}

@EventHandler
public void load(FMLInitializationEvent event)
{
	Proxy.registerRenderInformation();

	GameRegistry.registerBlock(RainbowOre, "RO");
	GameRegistry.registerBlock(ChocoOre, "CO");

	LanguageRegistry.addName(RainbowOre, "Rainbow Ore");
	LanguageRegistry.addName(ChocoOre, "Chocolate Ore");

	this.FlameEmitter.setCreativeTab(this.tabRandom);
	this.FireCrystal.setCreativeTab(this.tabRandom);
	this.Ash.setCreativeTab(this.tabRandom);
	this.SpellBk1.setCreativeTab(this.tabRandom);
	this.RainbowIngot.setCreativeTab(this.tabRandom);
	this.RainbowOre.setCreativeTab(this.tabRandom);
	this.RainbowDye.setCreativeTab(this.tabRandom);
	this.Chocolate.setCreativeTab(this.tabRandom);
	this.ChocoOre.setCreativeTab(this.tabRandom);
	this.RainbowPick.setCreativeTab(this.tabRandom);
	this.RainbowSword.setCreativeTab(this.tabRandom);
	this.RainbowShovel.setCreativeTab(this.tabRandom);
	this.RainbowAxe.setCreativeTab(this.tabRandom);
	this.RainbowHoe.setCreativeTab(this.tabRandom);
}

public RandomMC(){
	//GameRegistry
	GameRegistry.registerItem(FlameEmitter, "FE");
	GameRegistry.registerItem(Ash, "A");
	GameRegistry.registerItem(FireCrystal, "FC");
	GameRegistry.registerItem(SpellBk1, "SB1");
	GameRegistry.registerItem(RainbowIngot, "RI");
	GameRegistry.registerItem(RainbowDye, "RD");
	GameRegistry.registerItem(Chocolate, "Fc2");
	GameRegistry.registerItem(RainbowPick, "RP");
	GameRegistry.registerItem(RainbowSword, "RS");
	GameRegistry.registerItem(RainbowShovel, "Rs2");
	GameRegistry.registerItem(RainbowAxe, "RA");
	GameRegistry.registerItem(RainbowHoe, "RH");

	//Registry WorldGen
	GameRegistry.registerWorldGenerator(RainbowGen, 16);
	GameRegistry.registerWorldGenerator(ChocoGen, 16);


	//LanguageRegistry
	LanguageRegistry.addName(FlameEmitter, "Flame Emitter");
	LanguageRegistry.addName(Ash, "Ash");
	LanguageRegistry.addName(FireCrystal, "Fire Crystal");
	LanguageRegistry.addName(SpellBk1, "Spell Book of the Grenadier");
	LanguageRegistry.addName(RainbowIngot, "Rainbow Ingot");
	LanguageRegistry.addName(RainbowDye, "RainbowDye");
	LanguageRegistry.addName(Chocolate, "Chocolate");
	LanguageRegistry.addName(RainbowPick, "Rainbow Pickaxe");
	LanguageRegistry.addName(RainbowSword, "Rainbow Sword");
	LanguageRegistry.addName(RainbowShovel, "Rainbow Shovel");
	LanguageRegistry.addName(RainbowAxe, "Rainbow Axe");
	LanguageRegistry.addName(RainbowHoe, "Rainbow Hoe");
}
}

 

I have tried the crafting recipes

under the game registry and under the load notation

 

[move]Thanks for helping me create my mod!  :D[/move]

I'm not sure but I suspect the problem is that you're missing up single quote marks ' and double quote marks "

 

If you use single quote mark, it means it is a character and double quote marks mean string.  The error seems to do with you using the wrong one when the other is expected.

 

At least that is my guess.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.