Jump to content

[SOLVED] Custom crop is tile.null.name


Recommended Posts



I'm having a bit of trouble with my custom bean block. Whenever I load it in minecraft, it's displayed as tile.null.name instead of tile.BlockBean.name. What do I need to do to fix this?

Code for BlockBean class:

public class BlockBean extends BlockBush implements IGrowable {

protected int maxGrowthStage = 7;

    protected IIcon[] iIcon;

    public BlockBean() {
    	// Basic block setup
        float f = 0.5F;
        setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);

    protected boolean canPlaceBlockOn(Block parBlock) {
        return parBlock == Blocks.farmland;

    public void incrementGrowStage(World parWorld, Random parRand, int parX, int parY, int parZ) {
        int growStage = parWorld.getBlockMetadata(parX, parY, parZ) + MathHelper.getRandomIntegerInRange(parRand, 2, 5);
        if (growStage > maxGrowthStage)
        	growStage = maxGrowthStage;
        parWorld.setBlockMetadataWithNotify(parX, parY, parZ, growStage, 2);
    public Item getItemDropped(int p_149650_1_, Random parRand, int parFortune) {
        return CommonProxy.itemBean;

    public int getRenderType() {
        return 1; // Cross like flowers

    public IIcon getIcon(int parSide, int parGrowthStage) {
    	return iIcon[parGrowthStage];
    public void updateTick(World parWorld, int parX, int parY, int parZ, Random parRand) {
        super.updateTick(parWorld, parX, parY, parZ, parRand);
        int growStage = parWorld.getBlockMetadata(parX, parY, parZ) + 1;
        if (growStage > 7)
            growStage = 7;
        parWorld.setBlockMetadataWithNotify(parX, parY, parZ, growStage, 2);
    public int quantityDropped(Random rand) {
        return 1;
    public void registerBlockIcons(IIconRegister parIIconRegister) {
          iIcon = new IIcon[maxGrowthStage + 1];
          // seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want
          // to make generic should loop to maxGrowthStage
          iIcon[0] = parIIconRegister.registerIcon("nw:BlockBean_stage_0");
          iIcon[1] = parIIconRegister.registerIcon("nw:BlockBean_stage_1");
          iIcon[2] = parIIconRegister.registerIcon("nw:BlockBean_stage_2");
          iIcon[3] = parIIconRegister.registerIcon("nw:BlockBean_stage_3");
          iIcon[4] = parIIconRegister.registerIcon("nw:BlockBean_stage_4");
          iIcon[5] = parIIconRegister.registerIcon("nw:BlockBean_stage_5");
          iIcon[6] = parIIconRegister.registerIcon("nw:BlockBean_stage_6");
          iIcon[7] = parIIconRegister.registerIcon("nw:BlockBean_stage_7");
     * Need to implement the IGrowable interface methods
    // checks if finished growing (a grow stage of 7 is final stage)
    public boolean func_149851_a(World parWorld, int parX, int parY, int parZ, boolean p_149851_5_) {
        return parWorld.getBlockMetadata(parX, parY, parZ) != 7;

    public boolean func_149852_a(World p_149852_1_, Random parRand, int p_149852_3_, int p_149852_4_, int p_149852_5_) {
        return true;

    public void func_149853_b(World parWorld, Random parRand, int parX, int parY, int parZ) {
        incrementGrowStage(parWorld, parRand, parX, parY, parZ);

Link to comment
Share on other sites

You should set the block's name.. (by setBlockName or setUnlocalizedName)

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

setUnlocalizedName() is for naming items

setBlockName() is for naming blocks

I'm beginner in java and in minecraft modding.

Please be specific.

Any code examples are appreciated.

Sorry for my english i'm from Czech republic.

Please hit that thank you button if i helped :)

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.

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.