Posted November 12, 201410 yr this is the main block package com.raze.blocks; import java.util.Random; import com.raze.item.*; import com.raze.main.*; import com.raze.lib.*; import net.minecraft.block.Block; import net.minecraft.src.*; import net.minecraft.world.World; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.functions.*; public class Mods_CarbonOre { public static void mainRegistry(){ initializeBlock(); registerItem(); } public static Block CarOre; public static void initializeBlock(){ CarOre = new CarOre(Material.rock) .setBlockName("CarOre") .setCreativeTab(CreativeTabs.tabBlock) .setBlockTextureName(RefStrings.MODID + ":CarOre") .setHardness(4.0F) .setResistance(15F) .setStepSound(Block.soundTypeStone); } public static void registerItem(){ GameRegistry.registerBlock(CarOre, CarOre.getUnlocalizedName()); } } This is the chain for it package com.raze.blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import com.raze.item.*; import com.raze.blocks.*; import com.raze.main.*; import com.raze.lib.*; import net.minecraft.item.*; public class CarOre extends Block{ protected CarOre(Material p_i45394_1_) { super(p_i45394_1_); // TODO Auto-generated constructor stub setHarvestLevel("pickaxe", 2); } @Override public Item getItemDropped(int metadata, Random random, int fortune) { return raze.Raze_carbondrop; } }
November 15, 201410 yr Author package com.raze.main; import com.raze.blocks.*; import com.raze.item.*; import com.raze.lib.RefStrings; 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.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @Mod(modid = RefStrings.MODID , name = RefStrings.NAME , version = RefStrings.VERSION) public class MainReg { @SidedProxy(clientSide =RefStrings.CLIENTSIDE , serverSide =RefStrings.SERVRERSIDE ) public static ServerProxy proxy; @EventHandler public static void PreLoad(FMLPreInitializationEvent PreEvent){ Raze_carbondrop.mainRegistry(); Mods_CarbonOre.mainRegistry(); proxy.registerRenderInfo(); } @EventHandler public static void load(FMLInitializationEvent event){ } @EventHandler public static void PostLoad(FMLPostInitializationEvent PostEvent){ } }
November 15, 201410 yr Well that was useless, post Raze_carbondrop and Mods_CarbonOre Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
November 15, 201410 yr Author package com.raze.item; import com.raze.lib.*; import com.raze.blocks.*; import com.raze.item.*; import com.raze.main.*; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class Raze_carbondrop { public static void mainRegistry(){ initializeItem(); registerItem(); } public static Item CDrop; public static void initializeItem(){ CDrop = new Item().setUnlocalizedName("CDrop") .setCreativeTab(CreativeTabs.tabMaterials) .setTextureName(RefStrings.MODID + ":CDrop"); } public static void registerItem(){ GameRegistry.registerItem(CDrop, CDrop.getUnlocalizedName()); } } package com.raze.blocks; import java.util.Random; import com.raze.item.*; import com.raze.main.*; import com.raze.lib.*; import net.minecraft.block.Block; import net.minecraft.src.*; import net.minecraft.world.World; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.functions.*; public class Mods_CarbonOre { public static void mainRegistry(){ initializeBlock(); registerItem(); } public static Block CarOre; public static void initializeBlock(){ CarOre = new CarOre(Material.rock) .setBlockName("CarOre") .setCreativeTab(CreativeTabs.tabBlock) .setBlockTextureName(RefStrings.MODID + ":CarOre") .setHardness(4.0F) .setResistance(15F) .setStepSound(Block.soundTypeStone); } public static void registerItem(){ GameRegistry.registerBlock(CarOre, CarOre.getUnlocalizedName()); } }
November 15, 201410 yr I think toy need to actually create an item class that extends Item. What you have done there may be possible but i have never seen it done before. And you still havent clarified the problem do you mean the block dosnt drop that item when you break it? I am the author of Draconic Evolution
November 15, 201410 yr Well this shouldn't even compile: @Override public Item getItemDropped(int metadata, Random random, int fortune) { return raze.Raze_carbondrop; } Because Raze_carbondrop is not of type Item. In fact, I'm not even sure it points to a class that exists ("com.raze.item.Raze_carbondrop" != "raze.Raze_carbondrop") Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
November 15, 201410 yr In future try to give more detail in your first post then just "Its not working. Help me fix it" I am the author of Draconic Evolution
November 15, 201410 yr Author K the probblem is that the block dose not drop the item i have given "Raze_carbondrop" and i have tried so thats it
November 15, 201410 yr "Raze_carbondrop" is not an item it is your ModItem class try Raze_carbondrop.CDrop I am the author of Draconic Evolution
November 16, 201410 yr Author "Raze_carbondrop" is not an item it is your ModItem class try Raze_carbondrop.CDrop If i do this it still drops its self
November 17, 201410 yr "Raze_carbondrop" is not an item it is your ModItem class try Raze_carbondrop.CDrop If i do this it still drops its self Negative. CDrop is of type Item and Items don't drop Items, Blocks drop Items (or Blocks, but Blocks are also Items). Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
November 17, 201410 yr CarOre is of type Block and he is trying to get it to drop CDrop. By "It still drops itself" i think he means the blocks still drops its itemblock and not CDrop (@OP FIX YOUR NAMES!) Try adding the following to your block it should make your block drop an apple when harvested. If that works you can rule out the block as the problem. @Override public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return Items.apple; } I am the author of Draconic Evolution
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.