Let’s create a custom block entity oh all right we found ourselves back intelligent once more and in this tutorial we’re going to be adding a custom block entity or for those of you who don’t quite know what that is that is basically a custom furnace so to Speak so this is actually a quite a bit more of an advanced topic in this case so what i basically want to say is that number one as of course with all of the things that we’ve been doing so far you know a lot of java knowledge here is Definitely required now everything will be available to you in the description below of course in a github repository as well as the gist as well now there are quite a few things that i will copy over i will try to do it you know piecemeal so i’m basically going to try To do it method by method rather than just the entire class now we’re going to copy over one entire class because that’s just sort of a boilerplate class that we have to use one way or the other and then the rest we’re going to basically see so the plan here is that We’re going to make our gym infusing station block right here instead of just being a normal block we’re going to of course make this now a block entity now how do we do this well we can start at a few places first of all we’re just going To make a new package in the block package and we’re going to call this the entity package and then instead of there we’re going to make a new java class and this is going to be an interface which is going to be called the implemented inventory this is just going to help us A little bit in well in terms of basically implementing some stuff i will copy the entirety of this over now once again this is available to you in the description below and the github repository or the just as well let’s see there should be no errors when we copy This over as you can see it’s just a sided inventory basically you know you know already implemented this has been done by jews but here but it is under the public domain license so just keep that in mind you can basically use it you don’t even have to give the author Credit but you know i think that this is the right thing to do and we will need this later or actually right now when we actually make the entity so in the entity package in the block package we’re going to right click new java class and this is the gem in fusing Block entity now a block entity in this case is actually made up of three different parts the block entity class or you can even say four different parts the block entity class the block class we’re going to have a screen handler class as well as a screen itself so Those are four classes that you know make up an entire block entity and this is why i’m saying you know it can be quite complicated to basically look at this entire thing but we’ll get through this i am very sure of it so this is going to extend the block entity class Right here and it’s also going to implement both the named screen handler factory as well as the implemented inventory that we’ve just created let’s hover over this and implement methods this is going to implement the get display name the create menu method as well as the get items method and then we Hover over this again create constructor matching super and now we should be pretty much fine all things considered the first thing we want to do is remove the first parameter here from the constructor and just leave this you know empty over here just leave this as an Error that’s going to be fine and we are then going to return something proper here for the get items and that is going to be a new private final and that is a defaulted list of item stack in this case called inventory inventory there you go and this is equal To a defaulted list dot off and we’re just going to make this size three and item stack dot empty is the default value of this in this case why is that why would that be the case oh because it’s not copy of it’s actually of size there you go and that Should work no worries at all and now we basically created an inventory in this block entity so this would be the same idea when you have a furnace open right it also has three different slots so this is the number of slots that you have inside of this Inventory instead of this block entity and we can actually return this right here so it should just be this that inventory and that should be fine the display name we’re just going to make this a literal in this case the display name right here it’s just going to be Text.literal and we’re just going to say this is the gem infusing station if you want to make this proper of course you can make this a translatable text component in this case or a translatable text and that would be better now i’m also going to make a you know deliberate Error right here because we’ve not yet created the screen handler because there’s quite a few more steps that we actually have to go through before we do this and i basically want a deliberate error right here so that i can sort of remember to actually add this Here because if it’s just null then there’s no error and that can sometimes lead to me you know for someone forgetting this and uh because it is so complex and because there are so many steps that we have to go through it’s best to make errors in places where you Still have to add stuff later i i just i highly recommend doing that so that is currently the place where we want to leave the block entity and want to make a new class in the entity package again and that is the mod lock entities class and here of course We are going to register our entity but this is going to be a public static block entity type of type gem infusing block entity this is of course the underscore gym infusing a german underscore infusing underscore station and then we’re just going to leave it and then we’re going to have a Public static void register block entities method and inside of there we’re going to actually assign this yield so we’re going to say equal to registry making sure that we choose net minecraft util registry very important that we choose the correct registry class please make sure of that i’m going to say registry.block Entity type comma a new identifier no absolutely not a new identifier though yeah there you go or tutorial mod.mod id i’m going to call this the gem underscore infusing underscore station then after the first parenthesis comma and then a fabric block entity type entity type builder there you go dot create Passing in gem infusing station gem infusing block entity colon code new and then write immediately afterwards comma sorry there you go comma mod blocks dot gem infusing station after the first parenthesis that build passing in a null into the build and there we go that Should be all that we need to do here so you can see this can be quite complicated like i’ve said already everything is available to you in the description below or download and we can basically see we’re making a new block entity over here and in this case we’re Actually making we’re sort of combining the block entity and saying hey this is the block that you know belongs to the block entity now let’s immediately call this just so that we don’t forget this so this could be mod block entities dot register block entities and that is Pretty much this class done we don’t need to take a look at that at all anymore and we can also fix the first mistake over here or the first error let’s say and that is the mod block entities that gem infusing station passing that in here this is why we Didn’t need the first parameter if you still have the first parameter here then it will actually throw an arrow right here that is one of the things so it’s it should be an error right here it’s like something about you know the the factory does not match the the signing Or some crazy things like that so keep that in mind that the that your block entities only need the position as well as the state as its parameters here right now let’s move on to the actual block itself so if you already have this block made from last time that’s great If you don’t then you can just make a new block now it’s going to extend something else and that’s going to be the block with entity class and it’s also going to implement the block entity provider this one right here from the net minecraft block package let’s implement Methods that is the create block entity method and i believe that should be it yeah that’s actually all that we need we’re going to overwrite another method in just a moment but for now this is extremely important so please pay attention over here let me just do the Following let me just add a little bit of a comment over here just so they have this so everything here is basically block entity stuff right so this was all stuff or you know just the custom block shape and now we’re gonna do all of the block entity stuff and now the first Thing here is extremely important that is the get render type method you have to override this and you have to return the following you have to return block render type that model this is extremely important if you don’t do this then your block is going to be Invisible so if your block is invisible you have not overwritten this correctly keep that in mind we’re also immediately going to just copy over some methods that is these uh onstatereplaced method let’s see no errors present that’s great so what does this do well basically it’s Just going to spawn all of the items that are inside of this inventory right so inside of the block entity itself it’s just going to spawn them into the world so this is basically if we destroy this block all of the inventory is going to spill out this is very important if You want that to happen the next method is the on use method that is the right click method and once again there should be no errors present we’re basically making a new screen handler and we’re just saying hey just open the screen what this simply does is when you Actually right click this the block itself it’s going to say hey you know this is a block entity let’s create the screen handler that this block entity you know sort of belongs to that is the general idea and that is what happens here now here we just want to make a new Gem infusing station or gem infusing block entity passing in the position and this state that’s also going to be fine and then last but not least we also want to override the get ticker method this is basically needed so that we have a tick method inside of the block entity class which well Basically gets called every tick and we can then do all sorts of crazy things in there you’re going to see in just a moment we’re basically going to have progress and it’s going to increase and you know we’re going to have a an animation of an arrow that’s going down And all of that craziness is going to be very very interesting so in here what we basically want is a check type call and we’re going to pass in the type this is just from the right here from the parameter mod block entities that gem infusing station and Then the gem infusing station block entity colon colon tick now this method currently doesn’t exist so we’re going to have an error here but what we can do is we can just over you know like hover over it create tick method and we’re going to create it in the gem infusing Block entity and it should create it with all of the different parameters that we need now this e we can actually change let’s get rid of this for the moment and we can replace the e with the gem infusing station not block actually them infusing block entity very important and we’re going to Call this the entity as well that’s going to be fine now if we go back to the block this should be okay so you can see as long as the tick method has the correct parameters then it should be fine and that is pretty much the block Done as you can see all of the stuff you know under the block entity is the stuff that we need specifically when we you extend the block with entity as well as implementing the block entity provider interface over here so we can close this as well and continue with the i guess The block entity class so now now we’ll get into some very very interesting things because now we’re actually getting i would say a little more advanced here so first of all what we actually want is a few more fields over here and that’s going to be these ones i’m just going to Copy them over once again so this is a property delegate so this property delegate is very interesting we also have four integers and why do we need a property delegate and what is this even as a highest level overview a property delegate is pretty much sort of a Way of synchronizing data through the client and the server and it’s sort of like done automatically for us so this is going to be done so that the progress the max progress the fuel time and the max fuel time over here are going to be synchronized for the screen because the Screen itself right is just going to be the image that is displayed and that is client only and of course we have to sort of synchronize that when you open the client right you can have a progress bar and all that so this all needs to be synchronized and that is basically done Via a property delegate we’re going to see this in a moment and what i’m going to do is i’m going to actually assign this inside of the gem infusing block entity constructor here and i’m going to once again just copy this over you can see we’re basically making a new property Delegate you have to overwrite the get and the set method and here we’re just basically saying okay the get you know it’s just the progress the max progress the fuel time and the max fuel time in this case actually we don’t even need fuel that’s actually a very good point In this case and we only need the progress uh because the fuel you know it’s gonna be we’re gonna basically take a look at that in in a little bit but the fuel overall is going to be some sort of either energy or fluids but that is something that’s Going to be in a later tutorial right now we’re just going to implement the general you know gist of this general idea and that should pretty much be fine so these are the things that we need up here and we can then continue along and add two more methods and that is the Right nbt method this one right here just start writing that and then also the read nbt method now those are also going to be interesting because of course what happens is that if we you know leave the world if we close the world we want our inventory and our progress and all that To be saved right so this of course has to be saved therefore we actually need to add this so what we do in the right one is we do inventories dot right nbt we’re passing in the nbt and we’re passing in the inventory so this should Save the inventory now of course we also need to read the inventory right so we want to say inventory inventories dot read nbt passing in the nbt again and passing in the inventory again now i have this setup like this i am unsure if you have to call the Read over here before the super or not but i have found that this works it probably doesn’t matter but just in case just in case we’re gonna do it and then we also want to put in the integer over here this is gonna be the nbt put in and That is the gem underscore infusing underscore station dot progress and what do we want to save under this well we want to save the progress variable there you go and we of course also wanted to read this out so we’re just going to say progress equal nbt.getint and then just taking the same Key over here it’s going to be a little bit easier just pasting it in there you go and that should be the right nvt and the read nbt methods very interesting indeed and then we can actually continue with the tick method now i’m going to Sort of try to you know explain this as i go along so first of all we’re going to do if world that is client i just want you to basically return so i am not 100 sure i have found this to be the thing that you want to do while doing You know doing stuff with my own mod um this may or may not be the thing that you actually want to do i am unsure about it but for the time being this is what i found to work so keep that in mind as well this might not be the Ultimate actual thing that you want to do however i found this to work okay then what do we want to do well i’m just going to you know start writing stuff in and you know with methods that don’t exist yet but that’s okay so we’re going To say hey has a recipe so that’s the entity that we have has have a recipe inside of it right so if that is the case then we want to say entity.progress plus plus right we want to increase the progress we also this is extremely important we want to mark dirty so we Have to pass in the block position and the state so this basically um reloads this particular i’m not sure if it reloads the chunk but it definitely reloads this block position itself uh we have to do this when you change it so that it synchronizes once again server and client And then we want to say hey if the progress of the block entity is bigger or equal then to the entity.max progress right so if we have achieved the max progress that we want to achieve then we want to craft the item right once again passing in the entity and yeah that’s Pretty much it now if there is no recipe right what we want to do of course is we want to reset the progress so that’s just what i’m going to do so we’ll just say reset progress so we’re going to call the reset progress method on the Entity and we’re also going to mark dirty here this is still very important otherwise the progress is not properly safe basically or not properly synchronized i believe that in the craft item method we’re actually resetting the progress as well now you could do it inside of the method or you could do it Like in line here but that’s gonna be fine hopefully the general idea here makes sense right we’re basically just going through so every tick every 20th of a second we’re saying hey we have a recipe in this entity if we do then we’re just gonna increase the progress We’re gonna mark dirty and then if the progress is bigger or equal to the max progress then we’re going to craft the item and now let’s implement each of these methods so let’s hover over the actual recipe here um we’re going to no this is not the right one by the way We’re going to want to do more actions and we want to make a method create method has recipe right here this is a boolean method of course and we’re first of all going to implement it without a custom recipe type and then in the next tutorial we’re going to be adding a Recipe type as well but luckily it’s going to be fairly you know straightforward on how this is going to be implemented and so that’s actually going to be a very easy thing to do so let’s start with first of all the first few lines and that is going to be a Simple inventory now this we’re going to need regardless of whether or not we have a custom um you know recipe or not and then we want to say okay we just want to basically see a do we have a raw gem in first slot right that’s what we Basically want to check and we’re just going to do this by doing entity.getstack so we can get stack from any type of slot that we have inside of this block entity now this is actually slot one uh i will show the i will show the gui in a moment and then This makes way more sense because we’re gonna have a slot zero that’s gonna be for you know any type of basically fluid stuff and then we’re gonna have a slot one that’s gonna be at the top where you actually put in the ingredient and then we’re gonna have a slot two and that’s Gonna be the output slot that’s gonna be the actual get item here get item and if that is mod items.raw tanzanite then i’m going to be fine and then we’ll return a few things the first one is the has raw gem in first slot right so basically Making sure hey do we even have a particular recipe in this case quote-unquote recipe inside of the slot yes and then we want to make sure two things the first thing we want to make sure is that and insert amount into output slot so what does that mean right so Basically what i want to do is i want to make a method that checks whether or not we can even insert you know x amount of a new you know a new item into the output slot of this particular inventory and we also want to make sure can insert item into output slot This is inventory and then the item itself is going to be mod items.tanzanite so those are two methods that we have to create as well but that’s no worries at all let’s hover over this create method and let’s hover over this create method now i actually think that what i want to Do is i want to also add a count here let’s just do one in this case and let’s just do an int count so that should be fine and then here we want to return and say inventory dot get stack this is 2 because 2 is our output slot we’re going To say get max count so we want to say hey what is the max count of this particular item and if this is bigger than the inventory dot get stack 2 dot get count nope get count actually so now i want the actual count plus count then we’re gonna be uh fine so What does this make sense at the first glance you might say wait this doesn’t make any sense okay let’s think about this can i insert this amount right this new amount into this basically this has to be true while i can insert it and that’s why it’s it Might be a you know a wrong way around more or less right so it’s it could be more let’s say intuitive to do it the other way around and then negate it all but this is going to be fine um you know rest assured i’ve tried this and this Should be the way that this should work um and then also can insert item into output slot what does that mean well we basically want to make sure that the item itself is either empty or it is the same item because otherwise we’re just going to overwrite it so we’re going to Get the actual item from the from the um you know actual inventory itself and we’re going to say hey is this the same as the i mean tanzanite is okay but how about like we call this output that’s probably a little bit better and then One is just going to say hey is this output.getitem right or as item that’s fine and actually no we should just be able to do output or is the inventory.getstack 2 is empty no not is damageable but is empty there you go that’s exactly right so either it’s the Same item or it is empty and if that is the case then we have a recipe and we can increase the progress and at some point then we can craft the item so let’s hover over this read the method here as well the craft item method And how does this one look well we actually are going to need the same thing over here so we’re going to need the same you know inventory that’s going to be the same thing and then we’re just going to say once again if has recipe this is definitely not needed it’s just Sort of like a sanity check once again just in case it actually is the you know we have something and now we want to well remove stuff so we want to say entity.remove stack of you know inside here and we want to remove one of them right so count one so basically we’re Going to remove one raw gem if that is inside of the slot one fair and then we also of course of course want to add to slot two which is our output slot so we want to say set stack in slot two and we’re gonna make a new item stack in this case And mod items.tanzanite and here we wanna just wanna say entity.getstack into get count and then plus one so the reason i’m doing it like this is because if the stack is empty right you could also say well why aren’t we just sending the stack to itself Right entity stack that get two well if it’s empty then you know we don’t have anything in there that’s why i’m creating a new stack with the same count just added by one and we’re going to make it out of the tanzanite item in this case and now we just need the reset Progress method now i can actually just add this let’s just add this here now this is a non-static method in this case but you could in theory also make the static it doesn’t really make any difference and that is actually the block entity and all of the sort of Brain of the operation done right the tick method really is the brain of the block entity method in this case and that should pretty much be fine and it should pretty much work now we can go on to adding the screen as well as the screen handler that’s going To happen in a custom package so we’re going to make a new package in the tutorial mod class right click new package called screen and that will then also resolve the last error that we have here so here we need three classes the gem infusing screen we’re going to need The gem infusing screen handler and then last but not least we also need the mod screen handlers class as well this is of course where we register the screen handler let’s start with the screen handler yeah that’s going to be okay this extends the screen handler class right here let’s hover over this Implement methods the transfer slot method as well as the can use method and then we’re gonna hover over this again create constructor matching super now this is actually completely wrong we first of all gonna get rid of the first parameter here and then here we want to Actually get the following we want to make a player inventory that’s called inventory we also want to make a inventory that’s going to be called inventory and then we also want the property property delegate that’s going to be called a delegate and that’s going to be Fine now this is going to be okay we’re just going to keep it like this however we will make this public and then we’ll make another public gem infusing nope gem infusing screen handler and that’s going to be the int sync id so that’s going to Be the same parameter as well as the player inventory inventory and we’re going to call the other par the other constructor through this we’re just going to say this passing in the sync id and the inventory and then we’re going to make a new simple inventory nope absolutely not a simple inventory though There you go of size three now very important this size right here has to be the same size as we are supplying right here in the gem uh or in the block entity right so this is the size of our inventory this has to be the same size Keep that in mind and then we’re also going to make a new array property delegate of size 2. this here this size right here has to be the same size as in the property delegate right here of course the size here being how many different you know basically how many Different integers are we tracking in this case right of course two right we have one two should be fairly self-explanatory nothing too crazy going on here and that should be all that we need in this case let’s end this with a semicolon absolutely and then the type We’re going to fix that in a moment uh oh that’s actually not right this is the player inventory there you go and then this error should also go away and then let’s take a look at the transfer slot method okay the transfer slot method is very interesting what i basically always Do there is i’m just going to copy this over and i basically then never want to take a look at it again because the transfer slot method basically is used for shift clicking into this inventory and i hate it i it’s yes we could go through this i can explain everything is Absolutely not necessary it’s just a convoluted mess and i i don’t like it i don’t like it now we will need two fields here as you can see the inventory field does not exist yet so we’re gonna need a inventory field as well as a property delegate field now those are of Course all assigned right here first of all we want to say check size and we want to say inventory three so that the inventory of the block entity is actually you know expected size three we also want to say then this that inventory is equal to the inventory Parameter and we can say the same thing we can say inventory.on open and then passing in the playerinventory.player there you go that’s exactly what i want to do and then we can also say this.propertydelegate or yeah probably delegate equals to delegate there you go just make this format correctly and There we go now we’re not quite done yet we will need to add a few more things in here but first of all let’s figure out the other method here so the can use method actually fairly straightforward it’s just going to be this.inventory that can play or use and then passing in The player now we’re going to need two helper methods i’m just going to copy over that is the add player inventory as well as the add player hotbar and those methods are interesting because well basically we those are always going to be the same right the inventory usually of the Player is always going to be three rows and then it’s going to have like you know nine slots and all that craziness so this is basically just two helper methods so that we don’t have to put this into the constructor and that’s exactly what we want to add right here So we want to say add the inventory first passing in the player inventory there you go and then as the second one we want to call the player hot bar passing in the player inventory as well now something in between here is actually going to go and that is going To be the slots so we basically wanted to add our custom slots in here because the screen handler itself is responsible for handling the screen right so this is handling the inventory and all of that jazz so we basically want to add the slots so we’re going to say this start As slots or add slot with a new slot over here uh passing in the inventory then the index so the index just starts at 0 and then counts up and then we need an x and a y position i’m going to show the x and y position in just a moment And where i got those from it actually is a fairly straightforward and then like i said the index just counts up this is going to be 86 and 15 and this is 86 and 60. perfect that’s going to be fine and then last but not least we also Want to call the add properties over here and passing in the delegate so that is pretty much everything done except for this type we’re going to fix that in just a moment and yeah that pretty much sums up this class so like i said the screen handler the um the ad Properties here just make sure that the property delegates that we’ve added right here right so the progress and the max progress is actually synchronized through client and server now we can actually add the last two methods as well i think those should work yeah the is crafting method and the get scale Progress method now those two in this case are you know more or less done manually or you know more or less just done by myself and we’re basically just checking hey you know are we getting any progress then we are crafting and then we’re also saying i get the scale Progress because we want the progress regardless of what the progress is we want a uh sort of well basically a scale progress so that the arrow itself you know displays depending on how far along the progress we are right now let’s go to the mod screen handlers to fix the Last mistake here this is going to be the public static screen screen handler this is actually screen handler type very important of type gem infusing screen handler and this is the gem underscore infusing underscore screen underscore handler there you go and this is once again a public static void Register all screen handlers and this will do the following it will just do a gem infusing station screen handler equals to a new screen handler type and then just passing in the gem infusing yeah gem infusing screen handler colon colon new that’s all that we need to do And that should pretty much be it and we of course want to call this right here as well mod screen handlers dot register all screen handlers there you go and that should pretty much be that now we can change the type over here to mod screen handler start them infusing a Screen handler and no more errors should be present right here and then we can go into the block entity itself and fix this error as well we can just say a new german fusing screen handler passing the sync id passing the inventory from the player pass in this and then pass in this.propertydelegate And there we go no more errors present here as well and the last thing we have to do is just add the screen perfect perfect perfect let’s take a look at the screen class the screen class extends the handled screens nope that’s not right at all it’s actually the handled Screen that’s very important that’s a that’s that would be a very bad mistake uh of type gem infusing screen handler we’re going to hover over this implement the methods that is the draw background method absolutely and then we’ll hover over this again create constructor matching super now what we want is we Want an identifier for the texture just going to copy this over it’s under textures gui or gui as i like to call it gem infusing station gui this is under textures and then a new folder or a new directory called gui and i’m going to copy over the gui and then I will also explain what the frig is going on with that so let’s just copy this over and i’m going to show you so this is the gui at the moment you can see you know roughly speaking what is going on this is slot zero there’s a slot one there’s A slot two and we also have a tank and we also have an energy display which are going to be you know implemented in a later tutorial but i also already wanted basically the full um inventory here available and uh yeah we’re gonna see this in a moment as well now the Coordinates if we think back to our screen handler right 12 15 are basically the top left coordinates of our of our well a gui basically right so the gui itself is literally just the image right the screen itself is just this image basically it’s nothing else And um yeah and the rest is done in the screen handler so the slots right where you can actually put items into that’s all done right here if it’s all done with this slots that should pretty much be that now let me just quickly you know Import or you know copy over the rest here so we have init so um i don’t think we even need this but this basically centers the title uh if i’m not mistaken and the get draw background method here we’re just going to add the although the boilerplate code that’s Going to be added always right so this is going to be added always and we also want to override the render method this is also extremely important otherwise you won’t have the sort of darkening effect around the texture and it’s actually going to look very very strange Now let’s then copy over my last method over here and that’s going to be very interesting and we’re going to immediately call this right here this is the render progress arrow method passing in the matrices passing it in x and y so what is going on right here so basically If we’re crafting right so this is basically where we have this one right here with the probability delegate of you know i mean not size 0 but of index 0 is bigger than 0 so if we have any type of progress right basically meaning if we have any type of recipe inside of Our block entity then we are okay we are now crafting if that is the case then we’re going to start drawing a texture and now you’re going to be like where do all those crazy numbers come from this is insanely confusing first of all i’m going to agree with you on this however This is actually not as crazy number one try out a bunch of stuff and figure this out number two i’m going to explain so the best thing is to have the gui open as well and think about this okay so we have an x and a y um here now what is 105 well 105 is actually should be and i’m hoping that it is because i’ve not been thinking about this for a little bit but i think it should be right here that’s 105 x okay interesting so what is 33 um y then well that’s just down 33 And then we’re here oh so this is where we draw this texture but then the question is but what texture do we draw well this is determined by the u and the v we’re just moving into the x direction 160 uh 76 you know pixels and then we’re Right here it’s like oh okay but how do we know like what to draw right it’s like oh well it is um of width eight okay so then it’s width eight and then we know that we’re eight right but how how do we know the height well this is The height it’s the scale progress so based on how much progress it is we’re drawing more or less of this arrow so that is the general idea if this was a little confusing to you i highly recommend just playing around with this a little bit um it is very confusing in The beginning but once you get the hang of it and understand what the numbers mean then it is totally like you will understand it x and y by the way is the top left corner of the gui that’s the general idea so that should be pretty much the top left Corner of the gui while then you just do an offset and with that we should have everything done i am cautiously optimistic but i’m pretty sure that this should be all that we need to do and it should work ah we actually do need to still reference the handler so this screen you Can see it’s currently gray so we’re not you doing anything with the screen and that is going to be done in the tutorial mod client so let’s just go in here and we’re just going to say this is the handled screens this time it is screens that register passing in mod screen handlers.geminfusingscreenhandler And then just the gem infusing screen i’m infusing screen colon colon new no errors should be present and then it should actually work now wouldn’t this be freaking awesome if it worked first try it very much would you know if there’s any mistake we can Take a look at that as well but i’m pretty sure that it should work so let’s just go into the game and see if it works all right fans in minecraft and let’s just right click the uh block and there we go the gui works and we can see If we hover over stuff it also seems to work pretty well so let’s get a raw tanzanite over here let’s just get raw tanzanite and if i put it into slot one right so this is slot zero slot one slot two first of all let’s get rid of the Weather over here clear for forever let’s just go there you go and then let’s see so if we put a raw tanzanite in here the error should appear and once the arrow is done we should have a well something else here oh this is looking pretty good and there we go a tentative And i can just well i mean let’s do this there you go i can just put this in here and it should just keep creating tanzanite so that’s actually very interesting so you can see we actually are not so there’s a few things that are very interesting here so first of all We’re not adding the 64th one that’s actually very interesting and also once we are you know once we have one done we’re not resetting the progress but that’s of course something that’s very very easy to fix that should be done in the craft item method right so this is Why you want to you know roughly speaking have this you know kind of nicely separated so right here once we actually do this we want to say entity dot reset progress and that should reset the progress and then i guess what happens is that the count over here we Do want to do this instead of plus the count um i’m not sure about this though i’m not i’m not quite sure about this this might work this might not work but that should pretty much be the fixes and that is actually all that we need to do like I said the block entities are very very you know complex thing they are not as easy as you might think and uh there’s a lot of well interchanging or like you know interlocking parts basically right with a block entity and then you have a screen and then you have a screen Handler and all of that craziness so what i can just say is take a look at the github repository take a look at the gist copy over the classes make sure that this particular you know thing works and then you can go from there now what i actually highly Recommend is also that you check out the next tutorial that comes after this because there we’re actually going to add a custom recipe type which is going to make it much more expandable because let’s say now i’m going to say okay now we can add a tanzanite but let’s add Like five more different uh things and you know just make sure that this works that’s that’s ridiculous so we basically wanted to add a custom recipe type so that we can literally just make a custom json file just like the shape one here and we can just then just make the json Files and it’s it’s just going to work this out basically that’s also going to be very very interesting indeed so i highly recommend you check this out otherwise i hope you found this useful and you learned something new i really appreciate a like if you did and Otherwise i will see you in the next tutorial so yeah Video Information
This video, titled ‘Minecraft 1.19.1 Fabric Modding Tutorial | CUSTOM BLOCK ENTITIES | #22’, was uploaded by Modding by Kaupenjoe on 2022-08-22 13:59:47. It has garnered 9562 views and 164 likes. The duration of the video is 00:38:01 or 2281 seconds.
In this Minecraft Modding Tutorial, we are adding a custom Block Entity in a comprehensive Tutorial for Fabric with 1.19.1 (works in 1.19.2!).
== SUPPORT ME ON PATREON == ▶️ https://www.patreon.com/Kaupenjoe
== CATCH ME LIVE ON TWITCH == ▶️ https://www.twitch.tv/kaupenjoe
== ASSETS & DOWNLOAD LINKS == GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Fabric-Tutorial-1.19/tree/22-blockEntity Gist: https://url.kaupenjoe.net/yt400/gist Assets: https://url.kaupenjoe.net/yt400/assets
== TIMESTAMPS == N/A RIGHT NOW!
== 25% OFF FOR GAMING SERVERS == ▶️ https://www.bisecthosting.com/Kaupenjoe
== 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