Jump to content

Unable to drop items(Solved)


RegalBlaze

Recommended Posts

Hi guys,

 

This is probably very easy to fix but i don't know what is wrong.. I made a block of salt. When mined this block should drop 4 salt items. Think of redstone dropping redstone dust. I use the idDropped(){} code which used to work just fine, but now when it needs to drop an item nothing happens. I tried to let it drop blocks and it works just fine but when it should drop an item i get the following error: Attempted to add a EntityItem to the world with a invalid item: ID 601 at (-787,39,  4,68, 1122,23), this is most likely a config issue between you and the server. Please double check your configs

 

 

What should i do?

Link to comment
Share on other sites

There's another function saying how many items should drop.

 

Uh...ah, public int quantityDropped(Random par1Random)

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.

Link to comment
Share on other sites

I've added it but still the same error...

 

For good measure, here's my code

 

 

SaltBlock:

package mods.aom.common;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class BlockSalt extends Block {

public BlockSalt(int ID, Material material) {
	super(ID, material);
	this.setCreativeTab(CreativeTabs.tabBlock);
}

public void registerIcons(IconRegister iconreg){
	this.blockIcon = iconreg.registerIcon("aom:SaltBlock");
}


public int idDropped(int par1, Random par2Random, int par3)
    {
        return Aom.SaltID;
    }

public int quantityDropped(Random par1Random)
    {
        return  4 + par1Random.nextInt(5);
    }
}

 

SaltItem:

package mods.aom.common;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class ItemSalt extends Item {

public ItemSalt(int par1) {
	super(par1);
	this.setCreativeTab(CreativeTabs.tabMaterials);
}
public void updateIcons(IconRegister iconregister){
	this.iconIndex = iconregister.registerIcon("aom:Salt");
}
}

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.

×
×
  • Create New...

Important Information

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