Let’s grow some blueberries and let’s add a custom crop to minecraft all right we found ourselves back in children once more and in this tutorial we’ll be adding a custom crop block to minecraft now this is actually well not the craziest thing all things considered and also it’s very important actually That you have the knowledge of block state properties the thing we talked about last tutorial because we’re going to be using those in this tutorial as well so where do we start in our custom block package we’re going to right click new java class called the blue berry Drop block there you go and this will extends the drop block class there we go and we’ll hover over this create constructor matching super once again if the parameter name annoys you click on it press shift f6 properties and there we go now if we middle mouse button Click on the crop block class we can actually see all of the different methods that the crop block class overrides and you know has in it and we can see the integer property age now interestingly enough our blueberry crop only has six edges so we actually need to change something here We can’t use this age so what we want to do is we want to say public static final integer property called h equal to integer property dot create there you go old age with the minimum being zero and the maximum being six and then we need to override four methods that are very Important the first method to overwrite is the get base id seed now for this what we’re actually going to do is we’re going to make this return nothing at the moment not null because what you actually want to do is a deliberate error here so that i don’t forget to Actually add the items in there in a moment then we wanted to overwrite the getageproperty method this should return the age there you go then we want the get max h method this should return six basically whatever we are defining here as the max and then also of course the Create a block state definition method changing the parameter here once again to builder and then we can just say builder dot add and then adding the age property right here and that is actually all that we need in this crop block class so now let’s go into the mod Blocks and let’s actually register it so let’s just copy over the jumpy block here and this is going to be the blueberry underscore crop and the same name right here blueberry underscore crop and this is of course a blueberry crop block now the actual blockbehaver properties are going to be A little bit different they are actually not going to be of they’re going to be copy and the block we’re going to be copying is going to be blocks dot wheat there we go and then we also want something else and that is we don’t want to register a block here what we Actually want to do is we want to say blocks dot register now the question is why would this be a thing then also take away the creative tab here and then the error should go away now why is that the case we because we don’t actually want a Separate item to be created for this particular block here because the item that is going to be associated with this block is actually going to be the seeds item so in our mod items class we’re going to now add the seeds and the blueberry as well this is going to be The blueberry underscore seeds and then of course the name here as well blueberry underscore seeds and this is going to be an item name block item with its first parameter being the block that it represents so that’s going to be modblocks.blueberrycrop.get and then the item properties we’re just Going to be fine with this just making it stack to 64 again and that should be fine for this and then here we have the blueberry itself so this is going to be the thing that we’re actually you know wanting to harvest here this is the Blueberry and this is going to be a normal item now of course the interesting thing about blueberry is that we’re going to be able to eat it so instead of the stacks to one what we actually want is we want to call the food over here and then we want to make Some new food properties that builder you can see we already get this suggested press the tab key to autocomplete and then we want to set the nutrition now we can set a few things you can hear on here you can see the effect we could set a particular effect That you’re going to get added if you eat this particular food but we actually only want to call the nutrition method so let’s say two and then the saturation model which is also going to be two but a load here and then very important at the end we want to call dot build Otherwise it’s not going to work now we’ve added this we can now go back to the crop block class here the blueberry crop block and we say mod items.blueberryseeds.get and there we go and now all of the code here has been done now one very important thing in the Tutorial mod class we actually want to go to our client mod events over here and in the client setup we want to say item block render types this one right here dot set render layers mod blocks dot blueberry crop that get and then the second parameter is going To be the render type dot cut out this one right here because otherwise the see through parts of our crop texture are going to be white if we don’t do this so this is very important that we do this indeed and now on to the json Files which are going to be pretty crazy indeed now those will be copied over but everything including the json files and the code is all available to you in the description below get a password individual just as well but when you really look at it like while it is quite A lot when you really think about it it really just has different variants for all the different ages and it just points to a different block model json file when you really think about it not that crazy indeed let’s also add the translation here this is going to be the Blueberry and this is of course going to be called a blueberry and then we also have the blueberry underscore seeds let’s just add those as well there you go and then what you can also add is you can also add the blueberry underscore crop over here and call this the Blueberry crop now this will actually not show up for us but if you have something like one probe or what am i looking at or some sort of other mod that can actually display what type of block you’re looking for then this will also already be translated so i highly Recommend adding this as well now when it comes to the block model json files well there are seven of them because there are seven different textures in seven different ages so you can see seven different block model files that we are pointing to there are four seven Different block model files now when you actually take a look at them the actual contents are really easy to decipher you can see we’re just pointing to different textures the only thing here is that this is apparent minecraft block crop and the textures here point to a crop as Well so that is that really is all there is to it for the block model files for the crops for the item well we only have the blueberries and the blueberry seeds the actual block doesn’t have an item and those are just normal item model json files so nothing too crazy going on And let’s also add the textures then and yes of course that means that we have seven different textures here zero through six for the blueberry they go all of the different stages and then for the item we have only two the blueberry and the blueberry seeds and now you Might say well luckily this is done this is all that we need not quite because what we also want is a certain loot table for this particular thing so what we want to do is i will once again copy this over explain it a little bit and i Will show you the an equivalent in the external libraries as well this is the blueberry crop loot table and this is of course a loot table that is dependent on the block property because what’s very important is that the blueberry crop has to have h6 otherwise we’re not going to Drop the blueberries right it has to be fully grown in order to actually drop our blueberries and that is basically what this whole thing does now it might look quite complicated here but when you really look at it there are only certain things you need to change this block Right here whatever it drops there’s a blueberry then the seeds right here we also want to have another blueberry seeds right here and then also making sure that the block state property age here is the correct one that is really all that there is to it highly recommend Also going down to the external libraries all the way to our favorite extra 119 data minecraft loot tables blocks and we can look at the weed loot table over here double click on this and you can see it pretty much is the same thing just that the age here is actually Seven so the max h for the for the weed is seven and for us it was six so that is pretty much all that there is to it so while it could well it looks quite complicated there are really only a few differences here so nothing too crazy Going on and this is of course also available for download in the description below and that should be that now this is actually all that we need to do to add our own custom crop block to minecraft so let’s go into the game and see if it works all right it Found us in minecraft i see the blueberry and the blueberry seeds have been added so let’s see if we can even plant them down and there we go we can let’s get some bone meal here and let them grow and there we are and if we go back to survival mode very important Because otherwise they will not drop there we go they even drop that is exactly what you want to see now let’s actually take some damage over here where our normal that’s great and let’s see if we can also eat the blueberries once you know i’m a little bit hungry And we can see and there we go some hunger and let’s just start to eat them and mmm there you go we’ve eaten one of the blueberries so everything working exactly how we’d expect it to and that is how easy it can be to add a custom crop To minecraft and that concludes this tutorial right here i hope you found this useful and you learn something new and i’ll see you all in the next tutorial so yeah Video Information
This video, titled ‘Minecraft 1.19 Forge Modding Tutorial | CUSTOM CROPS | #9’, was uploaded by Modding by Kaupenjoe on 2022-07-07 13:59:51. It has garnered 11633 views and 201 likes. The duration of the video is 00:08:51 or 531 seconds.
In this Minecraft Modding Tutorial, we add a custom crop block to Minecraft 1.19 using Forge!
== MINECRAFT COURSES == ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 *
== ASSETS & DOWNLOAD LINKS == GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Forge-Tutorial-1.19/tree/9-crop Gist: https://url.kaupenjoe.net/yt353/gist Assets: https://url.kaupenjoe.net/yt353/assets
== TIMESTAMPS == 0:00 Intro 0:27 Making the Custom Crop Block Class 2:03 Registering the Custom Block 2:55 Adding the Seed Item 3:22 Adding a custom Food Item 4:07 Returning the Seed Item in the Block Class 4:17 Setting the RenderLayer for the Block 4:45 Adding the JSON Files 6:34 Looking at the Crop Loot Table 8:01 Demonstration 8:41 Outro
== TAKE A LOOK AT MY COURSES WITH COUPON CODES == ▶️ NEW Forge Modding with Minecraft 1.20.X: https://url.kaupenjoe.net/CourseForge120X ▶️ Learn Forge Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseForge118 * ▶️ Learn Fabric Modding with Minecraft 1.18: https://url.kaupenjoe.net/CourseFabric118 * ▶️ Complete and Roblox Lua Game Development: https://url.kaupenjoe.net/RobloxCoupon *
== SUPPORT ME ON PATREON == ▶️ https://www.patreon.com/Kaupenjoe
== SOCIALS == Discord: https://discord.com/invite/yqxykanpWf Personal Twitter: https://twitter.com/Kaupenjoe
Instagram: https://url.kaupenjoe.net/tutorials/instagram Facebook: https://url.kaupenjoe.net/tutorials/facebook Twitter: https://url.kaupenjoe.net/tutorials/twitter TikTok: https://url.kaupenjoe.net/tutorials/tiktok Written Tutorials: https://url.kaupenjoe.net/tutorials/blog
== LICENSE == Source Code is distributed under the MIT License. Additional Licenses for other assets can be seen below or in the accompanying CREDITS.txt on download.
== ADDITIONAL CREDITS == Outro Musik by Kevin MacLeod: “That’s a Wrap” Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 3.0 http://creativecommons.org/licenses/by/3.0
== AFFILIATE DISCLAIMER == * Some of the links and other products that appear in the video description are from companies which I will earn an affiliate commission or referral bonus from or are my own products. This means that if you click on one of the product links, I’ll receive a small commission or additional kickback without any additional cost for you. This helps support the channel and allows me to continue to make videos. Thank you for the support!
== HASHTAGS == #Minecraft #MinecraftModding #MinecraftTutorial #Kaupenjoe