perigrine3 Posted February 10, 2020 Posted February 10, 2020 (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 February 10, 2020 by perigrine3 Quote
devguydan Posted February 10, 2020 Posted February 10, 2020 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. Quote I hate signatures, they're too distracting
perigrine3 Posted February 10, 2020 Author Posted February 10, 2020 Not gonna lie, I'm new to this. How would I set up the block states? Quote
Ugdhar Posted February 10, 2020 Posted February 10, 2020 Look at the source for the vanilla crops, and the CropsBlock, it pretty much does everything you're talking about, and isn't very hard to implement. Quote
devguydan Posted February 10, 2020 Posted February 10, 2020 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. Quote I hate signatures, they're too distracting
Recommended Posts
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.