Jump to content

[1.7.2] Help! Mod keeps crashing due Crafting Recipe!


CraigTheMailman

Recommended Posts

My mod keeps crashing!

it will say:

 

Crash Report:

 

---- Minecraft Crash Report ----

// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]

 

Time: 5/17/14 3:13 PM

Description: Initializing game

 

java.lang.ClassCastException: com.CraigTheMailman.RandomMC.items.UnstableDiamond 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.load(RandomMC.java:177)

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.load(RandomMC.java:177)

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: 952432792 bytes (908 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.ItemArmor.ArmorMaterial;
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.armor.ArmorR;
import com.CraigTheMailman.RandomMC.blocks.ChocoOre;
import com.CraigTheMailman.RandomMC.blocks.RainbowBlk;
import com.CraigTheMailman.RandomMC.blocks.RainbowOre;
import com.CraigTheMailman.RandomMC.food.FoodChocolate;
import com.CraigTheMailman.RandomMC.items.Ash;
import com.CraigTheMailman.RandomMC.items.ChocoBoStaff;
import com.CraigTheMailman.RandomMC.items.FireCrystal;
import com.CraigTheMailman.RandomMC.items.FlameEmitter;
import com.CraigTheMailman.RandomMC.items.GoldenDiamondHammer;
import com.CraigTheMailman.RandomMC.items.GoldenDiamondIngot;
import com.CraigTheMailman.RandomMC.items.Infuser;
import com.CraigTheMailman.RandomMC.items.RainbowAxe;
import com.CraigTheMailman.RandomMC.items.RainbowDye;
import com.CraigTheMailman.RandomMC.items.RainbowHoe;
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.items.Unstable1;
import com.CraigTheMailman.RandomMC.items.Unstable3;
import com.CraigTheMailman.RandomMC.items.UnstableDiamond;
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;
public static int helm;
public static int chest;
public static int legs;
public static int boots;

//Tools
public static ToolMaterial Rainbow = EnumHelper.addToolMaterial("Rainbow", 3, 10000, 23.0F, 6.0F, 20);
public static ToolMaterial ChocoBostaff = EnumHelper.addToolMaterial("Chocolate", 0, 10000, 23.0F, 30.0F, 100);
public static ToolMaterial GoldenDiamond = EnumHelper.addToolMaterial("Golden Diamond", 0, 100000, 23.0F, 50.0F, 1000);

//Armor
public static ArmorMaterial RainbowArmor = EnumHelper.addArmorMaterial("Rainbow", 10000, new int[] {6, 24, 12, 4}, 24);

//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);
public static Item ChocoBoStaff = new ChocoBoStaff(ChocoBostaff).setCreativeTab(RandomMC.tabRandom);
public static Item RainbowHelmet = new ArmorR(RainbowArmor, helm, 0, 0).setCreativeTab(RandomMC.tabRandom).setTextureName("RandomMC:RainbowHelm");
public static Item RainbowChest = new ArmorR(RainbowArmor, chest, 0, 1).setCreativeTab(RandomMC.tabRandom).setTextureName("RandomMC:RainbowChest");
public static Item RainbowLegs = new ArmorR(RainbowArmor, legs, 0, 2).setCreativeTab(RandomMC.tabRandom).setTextureName("RandomMC:RainbowLegs");
public static Item RainbowBoots = new ArmorR(RainbowArmor, boots, 0, 3).setCreativeTab(RandomMC.tabRandom).setTextureName("RandomMC:RainbowBoots");
public static Item GoldenDiamondHammer = new GoldenDiamondHammer(GoldenDiamond).setCreativeTab(RandomMC.tabRandom);
public static Item UnstableGoldenIngot = new Unstable1(100012).setCreativeTab(RandomMC.tabRandom);
public static Item Infuser1 = new Infuser(100013).setCreativeTab(RandomMC.tabRandom);
public static Item UnstableDiamond = new UnstableDiamond(100014).setCreativeTab(RandomMC.tabRandom);
public static Item InfusedGoldDiamond1 = new Unstable3(100015).setCreativeTab(RandomMC.tabRandom); 
public static Item GoldenDiamondIngot = new GoldenDiamondIngot(100011).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 final Block RainbowBlk = new RainbowBlk(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)
{

}

@EventHandler
public void load(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});
			GameRegistry.addShapedRecipe(new ItemStack(this.ChocoBoStaff, 1), new Object[] {
				"X  ", " X ", "  X", 'X', this.Chocolate});
			GameRegistry.addShapedRecipe(new ItemStack(this.RainbowBlk, 1), new Object[] {
				"XXX", "XXX", "XXX", 'X', this.RainbowIngot});
			GameRegistry.addShapedRecipe(new ItemStack(this.RainbowHelmet, 1), new Object[] {
				"XXX", "X X", "   ", 'X', this.RainbowIngot});
			GameRegistry.addShapedRecipe(new ItemStack(this.RainbowChest, 1), new Object[] {
				"X X", "XXX", "XXX", 'X', this.RainbowIngot});
			GameRegistry.addShapedRecipe(new ItemStack(this.RainbowLegs, 1), new Object[] {
				"XXX", "X X", "X X", 'X', this.RainbowIngot});
			GameRegistry.addShapedRecipe(new ItemStack(this.RainbowBoots, 1), new Object[] {
				"X X", "X X", "   ", 'X', this.RainbowIngot});
			GameRegistry.addShapedRecipe(new ItemStack(InfusedGoldDiamond1, 1), new Object[] {
				UnstableDiamond, UnstableGoldenIngot});
			GameRegistry.addShapedRecipe(new ItemStack(this.UnstableDiamond, 1), new Object[] {
				Items.diamond, Infuser1, Items.lava_bucket});
			GameRegistry.addShapedRecipe(new ItemStack(this.UnstableGoldenIngot, 1), new Object[] {
				Items.gold_ingot, Infuser1, Items.lava_bucket});
			GameRegistry.addShapedRecipe(new ItemStack(this.GoldenDiamondHammer, 1), new Object[] {
				"XXX", "XYX", " Y ", 'X', GoldenDiamondIngot, 'Y', Items.stick});

			//Smelting
			GameRegistry.addSmelting(InfusedGoldDiamond1, new ItemStack(GoldenDiamondIngot, 1), 0.3F);


	Proxy.registerRenderInformation();

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

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

	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);
	this.ChocoBoStaff.setCreativeTab(this.tabRandom);
	this.RainbowHelmet.setCreativeTab(tabRandom);
	this.RainbowChest.setCreativeTab(tabRandom);
	this.RainbowLegs.setCreativeTab(tabRandom);
	this.RainbowBoots.setCreativeTab(tabRandom);
	this.GoldenDiamondHammer.setCreativeTab(tabRandom);
	this.InfusedGoldDiamond1.setCreativeTab(tabRandom);
	this.Infuser1.setCreativeTab(tabRandom);
	this.UnstableDiamond.setCreativeTab(tabRandom);
	this.UnstableGoldenIngot.setCreativeTab(tabRandom);
	this.GoldenDiamondIngot.setCreativeTab(tabRandom);
}

public RandomMC(){
	//GameRegistry
	GameRegistry.registerItem(InfusedGoldDiamond1, "IGD");
	GameRegistry.registerItem(Infuser1, "I");
	GameRegistry.registerItem(GoldenDiamondIngot, "GDH2");
	GameRegistry.registerItem(UnstableDiamond, "UD");
	GameRegistry.registerItem(UnstableGoldenIngot, "UGI");
	GameRegistry.registerItem(GoldenDiamondHammer, "GDH");
	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");
	GameRegistry.registerItem(ChocoBoStaff, "CBS");
	GameRegistry.registerItem(RainbowHelmet, "RainbowHelmet");
	GameRegistry.registerItem(RainbowChest, "RainbowChest");
	GameRegistry.registerItem(RainbowLegs, "RainbowLegs");
	GameRegistry.registerItem(RainbowBoots, "RainbowBoots");

	//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");
	LanguageRegistry.addName(ChocoBoStaff, "Chocolate Bo Staff");
	LanguageRegistry.addName(RainbowHelmet, "Rainbow Helmet");
	LanguageRegistry.addName(RainbowChest, "Rainbow Chestplate");
	LanguageRegistry.addName(RainbowLegs, "Rainbow Leggings");
	LanguageRegistry.addName(RainbowBoots, "Rainbow Boots");
	LanguageRegistry.addName(InfusedGoldDiamond1,  "Infused Unstable Gold & Diamond");
	LanguageRegistry.addName(Infuser1, "Infuser");
	LanguageRegistry.addName(GoldenDiamondIngot, "Golden Diamond Ingot");
	LanguageRegistry.addName(UnstableDiamond, "Unstable Diamond");
	LanguageRegistry.addName(UnstableGoldenIngot, "Unstable Golden Ingot");
	LanguageRegistry.addName(GoldenDiamondHammer, "Golden Diamond Hammer");
}
}

 

Class that can't be casted to  java.lang.character:

package com.CraigTheMailman.RandomMC.items;

import net.minecraft.item.Item;

public class UnstableDiamond extends Item {

public UnstableDiamond(int i) {
	this.setTextureName("RandomMC:UD");
	this.setUnlocalizedName("UD");
	this.setMaxStackSize(1);
}

}

 

Help!

[move]Please? :([/move]

Link to comment
Share on other sites

Your problem is here:

//GameRegistry.addShapedRecipe is wrong it should be GameRegistry.addShapelessRecipe(itemstack, object... params)
GameRegistry.addShapedRecipe(new ItemStack(this.UnstableDiamond, 1), new Object[] {
				Items.diamond, Infuser1, Items.lava_bucket});
GameRegistry.addShapedRecipe(new ItemStack(this.UnstableGoldenIngot, 1), new Object[] { 
Items.gold_ingot, Infuser1, Items.lava_bucket});

 

Corrected code:

GameRegistry.addShapelessRecipe(new ItemStack(this.UnstableDiamond, 1), new Object[] {
				Items.diamond, Infuser1, Items.lava_bucket});
GameRegistry.addShapelessRecipe(new ItemStack(this.UnstableGoldenIngot, 1), new Object[] { 
Items.gold_ingot, Infuser1, Items.lava_bucket});

 

Hope this helps

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • im stuck in a problem whit BlockEntities i cannot solve so im trying to work around it but in the less complex way possible  i think is posible to store data to the minecraft world  in older versions people talk about  WordDataSave i dont find anything about it for 1.20.4  i find a tutorial for player capability in 1.19    here is an event      //########## ########## ########## ##########     @SubscribeEvent     public static void onAttachCapabilitiesPlayer(AttachCapabilitiesEvent<Entity> event) {         if(event.getObject() instanceof Player) {             if(!event.getObject().getCapability(PlayerThirstProvider.PLAYER_THIRST).isPresent()) {                 event.addCapability(new ResourceLocation(mercmod.MOD_ID, "properties"), new PlayerThirstProvider());             }         }     }  soo i made this      //########## ########## ########## ##########     @SubscribeEvent     public static void onAttachCapabilitiesLevel(AttachCapabilitiesEvent<Level> event) {     } i think i can do some witchcraft  here  but is many things don't understand  to start whit i dont get yet how to recall the saved data from a BlockEntity  the handler still in progress the plan is to make a Map to store nbt data using the block coordinates as index later store that map as a big nbt      ########## any way the question is if theres alredy a tutorial for 1.20.4 for this ?? or some alredy working code from someone else doing something similar ?           
    • I tried this, and found out that Oculus is the mod that is crashing the game. I have removed it, and it now works fine! Thanks!
    • Hi @DanielderErbauer, I arrived here as I have the "as it does not exist in Block{minecraft:air}" error in a modpack I am trying to start. It's a long-shot, I know, but as the post that led this to being solved is missing, can I ask if you may recall what it said? Thanks in advance
    • Hm yeah sorry, not seeing anything else that's sticking out, I'd need to debug myself probably. Do you have a github or bitbucket repo? I could poke around when I have time to see what the problem might be.
    • looking around for the capabilities thing i found a piece of code and find this piece of code  //########## ########## ########## ########## @SubscribeEvent public static void addCustomTrades(VillagerTradesEvent event) { if(event.getType() == VillagerProfession.FLETCHER) { System.out.println("\n\n### VillagerProfession.FLETCHER \n\n");//<----------- Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades(); ItemStack stack = new ItemStack(ItemInit.ARROW_STEEL.get(), 16); int villagerLevel = 1; trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( new ItemStack(Items.EMERALD, 2), stack,1,3,0.02F)); } if(event.getType() == VillagerProfession.TOOLSMITH) { System.out.println("\n\n### VillagerProfession.TOOLSMITH \n\n");//<----------- Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades(); ItemStack stack = new ItemStack(ItemInit.INGOT_STEEL.get(), 1); int villagerLevel = 1; trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( new ItemStack(Items.EMERALD, 2), stack,10,8,0.02F)); } } //########## ########## ########## ########## the event is aknoledge and execute when the maps load  ### VillagerProfession.FLETCHER  ### VillagerProfession.TOOLSMITH  //########## But is not working      is a random piece of code is not working  could it be than this code is old 1.18 and no valid anymore for 1.20.4 or the thing are this numbers  stack,10,8,0.02F));  i dont know what this numbers means    ########## the question is ¿how to add things to the villager traders    thanks for your attention               
  • Topics

×
×
  • Create New...

Important Information

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