Jump to content

Recommended Posts

Posted (edited)

I'm trying to make a plant that grows over time, but I am unsure how to do that. In case you are unsure what I mean, I'm talking about stages of growth, like potatoes or carrots (although I'd like it to be shearable, so more like sweet berry bushes). I am also unsure how I am supposed to get it to call on the different textures for each stage. 

Edited by perigrine3
Posted

Just taking a shot in the dark, but would this be block states with different assets?

 

Just give each stage of growth a block state and a corresponding texture.

I hate signatures, they're too distracting

Posted

Check out this excellent example mod: https://github.com/Cadiboo/Example-Mod/. Check out the src/main/resources/examplemod/blockstates. Structure your mod similarly. To see how to control blockstates, check out src/main/java/examplemod/block/ModFurnaceBlock.

 

For an example of plant growth blockstates, here is the blockstates for vanilla's carrots.json: 

{
    "variants": {
        "age=0": { "model": "block/carrots_stage0" },
        "age=1": { "model": "block/carrots_stage0" },
        "age=2": { "model": "block/carrots_stage1" },
        "age=3": { "model": "block/carrots_stage1" },
        "age=4": { "model": "block/carrots_stage2" },
        "age=5": { "model": "block/carrots_stage2" },
        "age=6": { "model": "block/carrots_stage2" },
        "age=7": { "model": "block/carrots_stage3" }
    }
}

 

Here are the corresponding models for carrots: This is carrots_stage3.json, but obviously the other stages are very similar. 

 

{
    "parent": "block/crop",
    "textures": {
        "crop": "block/carrots_stage3"
    }
}

 

You can find all these your self in your External Libraries in Gradle: net.minecraft:client:extra.<version>

 

All this should be more than enough to get you started and more than anyone else here will give you. You'll need to do the rest of the discovery and experimentation yourself. Best of luck.

I hate signatures, they're too distracting

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.

Announcements



×
×
  • Create New...

Important Information

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