Hello hello hello everybody and welcome back to another minecraft modding tutorial for forge 1.19 in this tutorial we are going to be doing something extremely simple we’re not going to be covering anything crazy we’re just going to be showing you how to create a simpler way of registering your block and block Items so in the previous tutorial as you know we’ve registered our blocks and our block items however this was an awful mess as we have to basically uh both use our item in it and our blocking it just for a block and that’s really strange um it’s just weird so Let’s go ahead and fix that let’s go ahead into our block init okay and let’s go ahead and um okay what we’ll do we’ll create a method so we’re gonna pull this we’re gonna make this private it’s gonna be static and this is going to be a generic method so we’re going to Go t extends block okay and this will return our registry objective t okay and we’re going to we’re just going to call this you know we’ll just call it register and we’re taking a name first so our string name then we’re going to want a supplier of block Or a supplier of t actually and we’ll call this the we’ll just call it supplier and we’re also going to want an item dot properties and we’ll call that the properties okay what we need to do in here is create a registry object of type t And i’m going to call that the block is equal to blocks dot register and that will take in the name and the supplier okay and then we’re going to want to call item init dot items dot register and we’re going to pass in the name again And then we’re going to say a supplier of a new clock item and that’s just going to take in the block don’t get and it’s also going to take in the properties now the reason we can do dot get here is because this itself is inside of a Supplier so that won’t get run until this supplier is called don’t get anyways so that’s perfectly fine once again this is another circumstance of where you need to know whether it’s fine or not as i said before you can ask in my discord server which is linked in The description if you ever get stuck with something like that and then we just want to return the block so what we can do all we need to do now is remove this blocks here and obviously that’s not going to work because we’re saying that we need an item property as well So all we’re going to do is come into our item init and we’re going to take these item properties here so i’m just going to copy that and i’m going to go ahead and paste it in there and i’m going to copy this one and i’m gonna go ahead and paste this in Here as well and i think that’s one too many brackets yes it is same up there and that is it now i’m just going to go ahead and really quickly format some of this so let’s just say like that and i’ll do that here as well um actually Just a little bit simpler there and that is actually almost it we just need to come back into our item in it all we need to do now is remove these two block items because we’re registered with registering them here as you can see so yeah i mean that’s actually it we can Now just run the game and it should be the exact same there should not be any difference whatsoever which we are about to go ahead and find out and i’m pretty sure this should work here we are voila we still have our two block items and we should be able to Find them in our uh in here as well so yeah we’ve got that one and we got that one that’s it that’s our two block items so yeah i hope you guys did find this tutorial useful if you did please do be sure to tap that like button and Subscribe if you really found it useful then please do be sure to share it around i’m sure it’ll help other people as well and uh yeah i’ll see you guys in the next tutorial where we will cover uh actually breaking our block so loot tables not breaking as in You know making it not work but you know but you didn’t you know what i mean so yeah i’ll see you guys then good bye Video Information
This video, titled ‘1.19 Minecraft Forge Modding Tutorial – Better Block Registry’, was uploaded by TurtyWurty on 2022-06-23 16:30:04. It has garnered views and [vid_likes] likes. The duration of the video is or seconds.
Hello everyone, in this video we will be streamlining our block registry process by making our block items registered automatically …