Started by
Dilly
on
Topic category: Help with Minecraft modding (Java Edition)
I have a question about adding textures for crops. Do I need to create multiple sprites for a single block texture? And how do I change their textures? I couldn't even find how to change the refresh rate.
Custom crops are a complicated topic. You need to use blockstates (with the blockstates plugin) and create a texture & blockstates for each stage of growth. Then you can make a procedure that checks if the plant is below the maximum growth stage and if so, then adds one growth stage (changes the blockstate). Attach that procedure to the "On block random ticked" slot. You can also make the block bonemealable and put that procedure in the "On Block Bonemealed" slot.
Then you need to add the drops. In an "On block broken" procedure, you can check the growth stage of the blockstate and manually spawn items depending on the growth stage (seeds for < max and product/plant for max).
I used this method to create a custom hemp plant in one of my mods.
Hope this helps! :)
Thank you. I'll try that.
Should I use a random tick update or a constant one?
And does the blockstates counter start at 1 or 0?
Got it. Thanks
I have a question about creating sprites for crops. I made a PNG texture, but in the game it has a black background, even though there’s no background texture in Mcreator or in the system where I created it.
Hey LordZintick, im having issues finding an "on block broken" procedure. Ive found "when block destroyed by player" but that obviously only gets called when destroyed by a player specifically; All water based harvesting methods cease to function.
Perhaps you can help :)
Try using “update on tick” and check whether the block at coordinates block has been destroyed