Hello, I'm pretty new to minecraft modding and am currently trying to add my own crop that grows cookies. Most tutorials I find seem to still be for 1.7 so I'm having a hard time on some stuff, rendering for the most part. I've been struggling to get these crops to render correctly, as this is the first time I've had to deal with variants, as a reference I've been looking at how wheat is currently set up, so here is what I've got so far:
My blockstates, "cookieFlower.json" file:
{
"variants": {
"age=0": { "model": "cookieFlower_stage0" },
"age=1": { "model": "cookieFlower_stage1" },
"age=2": { "model": "cookieFlower_stage2" },
"age=3": { "model": "cookieFlower_stage3" },
"age=4": { "model": "cookieFlower_stage4" }
}
}
My block model: "cookieFlower_state0.json" file: (there are 5 states in all)
{
"parent": "block/crop",
"textures": {
"crop": "cookiemod:blocks/cookieFlower_stage_0"
}
}
My item model "cookieFlower.json" file (which I'm unsure is even needed, since you never have the crop block in your inventory, but just to be safe...)
{
"parent": "cookiemod:block/cookieFlower_stage_4",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
Registration:
//inside PreInit()
ModelBakery.addVariantName(Item.getItemFromBlock(cookieFlower), new String[]{modid+":"+"cookieFlower_stage0",modid+":" +"cookieFlower_stage1",modid+":"+"cookieFlower_stage2",modid+":"+"cookieFlower_stage3",modid+":"+"cookieFlower_stage4"});
//inside Init()
renderItem.getItemModelMesher().register(Item.getItemFromBlock(cookieFlower), 0, new ModelResourceLocation(modid + ":" + ((CookieFlower) cookieFlower).getName(), "inventory"));
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(cookieFlower), new ItemMeshDefinition()
{
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation(modid+"cookieFlower", "inventory");
}
});
I'm reasonably sure that I did all the .json files correctly, but I'm a little lost about all the registration, I took the time to read through http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html, but honestly I found it a bit over my head on the parts concerning variance..
The current error I'm getting is:
[13:06:50] [Client thread/ERROR] [FML]: Model definition for location cookiemod:cookieFlower_stage1#inventory not found
[13:06:50] [Client thread/ERROR] [FML]: Model definition for location cookiemod:cookieFlower_stage0#inventory not found
[13:06:50] [Client thread/ERROR] [FML]: Model definition for location cookiemod:cookieFlower_stage2#inventory not found
[13:06:50] [Client thread/ERROR] [FML]: Model definition for location cookiemod:cookieFlower_stage4#inventory not found
[13:06:50] [Client thread/ERROR] [FML]: Model definition for location cookiemod:cookieFlower_stage3#inventory not found
This error began when I added the ModelBakery.addVariantName() line; before then I had no errors, but no textures either, so I'm probably using the method incorrectly.
Any and all help will be greatly appreciated.
EDIT: I have since removed the ModelBakery.addVariantName() line as I realized that was for item variants rather than block variants, so I'm back to no errors and no textures.