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

I really haphazardly put together this code, taking code from Sugar Cane and seeing if it works. I got it so it works exactly like Sugar Cane, but it doesn't have any textures to it. I know I'm missing a part where I label each texture for each age of it, but I have no idea how to do that. So if you can help me out it'd be appreciated.

 

BlockBeans.java

package com.kansastoyou.mod.blocks;

import java.util.Random;

import com.kansastoyou.mod.init.RandomItems;

import net.minecraft.block.BlockReed;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.world.World;

public class BlockBeans extends BlockReed {

public BlockBeans(Material materialIn) {
	super();
	this.setHardness(0.3F);
	this.setResistance(3);
	this.setStepSound(this.soundTypeGrass);
}

@Override
public boolean isOpaqueCube()
{
	return false;
}

    public Item getItemDropped(IBlockState state, Random rand, int fortune)
    {
        return RandomItems.beans_harvested_item;
    }

    public int quantityDropped()
    {
        return 1;
    }

@Override
public EnumWorldBlockLayer getBlockLayer()
{
	return EnumWorldBlockLayer.CUTOUT;
}

}

 

It also says that i'm missing this in the console.

 

[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=10 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=7 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=6 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=15 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=5 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=4 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=12 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=11 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=14 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=9 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=13 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=8 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=3 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=2 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=1 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=0 not found

 

Screenshots:

 

XF1qsu1.png

In your blockstate json file for this block you have to state a model for each age it has.

 

{
    "variants": {
        "age=0": {"model": "MODID:REED_0"},
        "age=1": {"model": "MODID:REED_1"},
        "age=2": {"model": "MODID:REED_2"},
        "age=3": {"model": "MODID:REED_3"},
        "age=4": {"model": "MODID:REED_4"},
        "age=5": {"model": "MODID:REED_5"},
        
    }
}

add ages up to the ages you have set for your reed.

 

You can also refer to the same model for each age.

 

{
    "variants": {
        "age=0": {"model": "MODID:REED"},
        "age=1": {"model": "MODID:REED"},
        "age=2": {"model": "MODID:REED"},
        "age=3": {"model": "MODID:REED"},
        "age=4": {"model": "MODID:REED"},
        "age=5": {"model": "MODID:REED"},
        
    }
}

Make sure that your property and 'age' are spelled exactly the same and have the same case.

Long time Bukkit & Forge Programmer

Happy to try and help

  • Author

In your blockstate json file for this block you have to state a model for each age it has.

 

{
    "variants": {
        "age=0": {"model": "MODID:REED_0"},
        "age=1": {"model": "MODID:REED_1"},
        "age=2": {"model": "MODID:REED_2"},
        "age=3": {"model": "MODID:REED_3"},
        "age=4": {"model": "MODID:REED_4"},
        "age=5": {"model": "MODID:REED_5"},
        
    }
}

add ages up to the ages you have set for your reed.

 

You can also refer to the same model for each age.

 

{
    "variants": {
        "age=0": {"model": "MODID:REED"},
        "age=1": {"model": "MODID:REED"},
        "age=2": {"model": "MODID:REED"},
        "age=3": {"model": "MODID:REED"},
        "age=4": {"model": "MODID:REED"},
        "age=5": {"model": "MODID:REED"},
        
    }
}

 

I added that to my Blockstate and It's still not working. I didn't add anything really to my BlockBeans.java that tells it to act anything like Sugar Cane except it extending BlockReed. Where/how would I set up the ages in the Block class?

never ever copy paste sth without thinking and expect it to work. of course u ned to replace modid and reed.

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.