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

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;
    }
}

  • 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){

}

}

 

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.

  • 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());

    }

}

 

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

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.

  • 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

 

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

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.

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.