Hello and welcome back to another tutorial in today’s episode we’re going to be covering advanced blocks and items which includes custom block and item classes custom models and render layers custom block state properties tags foods and fuels and recipes and since i’m covering a variety of topics in this Episode you can skip to sections that suit you so if you don’t care about custom models you can skip straight to the recipe section and vice versa and this video is more like an explanation filler video since all of these topics are too small to have their own so i’m Going to start off with custom item in here we registered our example item over here with our json name example item and we’ve given it item properties but the only item property we’ve actually given it is the creative tab and if you go after here and press dot and if you Don’t see this menu you can press ctrl space you can see all the different things that you can do to your item so craft remainder so what happens if you craft the item so for example for a water bucket you’d leave the bucket in the crafting menu after it’s been Crafted the default durability and durability whether the item is fire resistant we can make it a food which i’ll discuss later you can give it a rarity so to do that you do dot rarity and then rarity dot and then the name of your rarity so common epic rare or Uncommon you can set no repair and use stacks 2 to set the maximum size of the stack so for example an ender pearl would be 16 or for something that’s non-stackable like a sword you want to set the stacks to one and you can chain These on so for example i want to make a fire resistant item which has a stack size of 12. and you can keep adding these on to create more things to your item but what if you want your item to have even more functionality perhaps functionality that isn’t included in Minecraft by default well to do that we can create a custom item class so in our com.cy4.tutorialmod package we’re going to right click and create a new package called item and in here we’re going to put all of our custom item classes so let’s right click on it and go to new class And create our example item class and our example items are going to extend item and we can press ctrl shift o to import net.minecraft.world.item.item then we can hover over this and add our constructor and if you want you can rename this to properties and the same Down here and this is our base item class so back in our item in it we can change this new item over here to a new example item and press ctrl shift o to import that and now we can add functionality to our item so in Example item we can go down a bit and press ctrl space and over here we can see all the methods that we can override so if i make this larger you can do some stuff you can do can attack block append hover text which is the tool tip You can say if it can fit inside containers so if you can put it inside like a chest or something if you can equip it and other stuff there’s loads that you can override here and i’m not going to cover them but a couple useful ones include finish using item that’s for something Like a food once you finish using it append hover text which is the dual tip and you have a bunch of stuff to do with sounds over here and much much more i’m going to press control space and override use and this function will be Run when a player uses an item so if we hold ctrl and click on users we can see what it does by default and this will just check if it’s edible and then eat it otherwise it will just pass the use and you can see that here we have a Consume so the item has been used a fail and a pass let’s rename the level to world since that’s our world our player to player and the interaction hand to hand and then change the things below accordingly just so that we understand what we’re actually writing let’s delete The to-do and in here i’m just going to write some example code but obviously this can be whatever you want i’m going to first check if the world is client side and many functions in the item class will often be run twice once on the server and once on the client and It’s really important to differentiate between the two so we’re just going to make sure that the world isn’t on the client and that we’re on the server so let’s add an exclamation mark here let’s do system dot out dot print line so just print something to the console and we’re Going to print player dot get name dot get string so the name of our player plus has used item with hand hand dot name and this will either be main hand or offhand so now when we run the game and pick up our example item and then right click you Can see in the console that we have dev used item with hand main hand and if we switch to our offhand you can see that it says offhand now let’s talk about more advanced blocks so let’s go into our blocking it and over here we have two things we have our Actual block itself and the item for that block and for that block item you can use the same properties as we used in the items so we have a dot tab and here we have a food rarity durability craft remainder fire resistant etc and this item properties describes how a Block behaves as an item and the block behavior describes how the block behaves when it’s placed down so from last episode you can see that we’re using a material which is metal and this just defines a bunch of basic stuff and you can see there’s a bunch of different Materials over here the material color is what shows up on the map our block is purple so i put it to color purple and if you hold ctrl and open material color you can see all of these codes which are the integer codes for the color if you Want to check what they are before you start the game the strength defines the hardness and blast resistance you might notice that there’s two different strength functions one of them has two values one of them takes one the one that takes one value just passes that One value into two values so if you just have 3.0 you’re setting both the hardness and the blast resistance to 3.0 but if you want them to be different you can do something like this which is going to set the hardness to 3 and the blast resistance to two and if you want To know what the default values are for the minecraft blocks you can look it up on google the sound defines the sound for the block so you can do sound type dot and then all of these different sounds that our blocks can be then we have requires Correct tool for drops which won’t call the loot table unless it’s using the correct tool we also have dot air which makes it equal to air dynamic shape which makes it not a full block and emissive rendering which will render a block despite its light level at full Brightness so something like a magma block and this takes a state predicate so to do that we can create a new predicate for which we’re going to pass in the state the getter and the position and then an arrow like so with a bracket and then This needs to return a boolean so if i just return true here it’s always going to use emissive rendering or i can decide it based on the state so given any properties inside the block or given the position so i can do return pause dot get x is equal to 50. so this Will just set it to emissive rendering only if the x position of block is equal to 50. we can also define if it’s a redstone conductor which also takes a state predicate if it will suffocate you also taking a state predicate if you can spawn on that block jump Factor which will multiply your jump height when you’re standing on the block so something like soul sand will have a low jump factor below 1 which makes your jump height smaller no collision makes it so that you can’t collide with it no drops removes all the drops random ticks Will randomly tick that block and light level will take an inter function which defines the light level of that block so this is going to be given a state and we’re going to output a light level say 4 which always gives you a light level or 4 and we can change this for Based on things inside the state if you would like to so now our block will render emissively if the x position is 50 and it will emit a light level of 4. so if we run the game and set the time tonight we can see that it emits a very Small light level of four so you can see there’s a very small circle around it you might not be able to see this because of the youtube compression but it is there and if we place it in a block where x is 50 you can see that it Will always render full brightness no matter what the light level is now let’s make a custom class for the block and this is very similar to the item we’re going to create a new package in com.cy4.tutorial mod called dot block into here we’re going to create a new class called example Block and this is going to extend block and let’s press ctrl shift o to import this world.level.block.block hover over this add a constructor rename the properties to properties and replace it down here as well and now we’ve created a basic block class back in our block in it we Can change this new block to a new example block press ctrl shift o to import and there we go now in our example block we can overwrite methods so we can press ctrl space to see all the possible methods and once again there’s loads of methods That you can use and most of these are going to be self-explanatory if you need a specific one you can join the discord and ask and someone should be able to help you i’m once again going to override the use function but this time this is when a block is clicked so Let’s set the block states to be called state the level to world block pulse to pause the player to player interaction hand to hand and the block hits result to result and let’s rename these stuff down here accordingly and this is going to give an error because this command is Deprecated so we’re just going to hover over that and make sure to suppress it and if we hold control and click on use we can see that by default it returns an interaction result pass so what we’re going to do we’re going to check if world dot is client side and once again We want to add an exclamation mark to make sure that we are on the server not the client we’re going to check if player dot get item in hand and this is going to give us the item stack that the player is holding dot get item dot equals and then we’re going to Do items dot diamond so that’s going to check if the item the player is holding is a diamond and if it is we’re going to system dot out dot print line and once again we’re going to get the name of the player so player dot get name Dot get string interacted with block at pause plus pause dot 2 short string which will just give us the string for the position and space using a diamond so that’s just going to print a message telling the user that the player has interacted with the block and if that Happens we’re going to return interaction result dot consume and it’s important to return the correct interaction result otherwise you might get some bugs consume will say that something has happened and the action has had some effect onto the world and if we start the game we can See that if we right click the block then nothing happens and our hand doesn’t move but if we hold the diamond and right click you can see that in the chat it says dev interacted with block at the position of the block using a diamond this video is sponsored by mtx Serve mtx serve provide game server hosting for games such as minecraft rust and valheim the servers are incredibly performant with a amd ryzen 5800x and unlimited ssd storage space as well as ddos protection and all of this for a pretty low price use code cy4 to get Five percent off your server today next we’re going to talk about how to make this block have a custom model so to do that we’re going to download a 3d modeling software called blockbench so let’s go to blockbench.net and you can use the web application but I’m just going to download it and i’m going to select windows but you can select your operating system and i’m going to download the installer and once it’s downloaded let’s run the installer and this is going to install blockbench and once it’s finished it will open blockbench and now we can create our Model and you can select your keybind preference i’m going to select the default mouse keybinds and then we can create a model and you can see there’s lots of different things and we’ll be using blockbench a lot in lots of different tutorials but we’re going to create a Java block slash item file name will be example underscore block it will have no parent model and we’ll just keep our texture sized let’s click confirm and you can see that we have our model i’m holding down on the middle mouse button to rotate it let’s add a cube and i’m Going to set this to have a size of 16 by 16 by 16. and just like that we have our full block but i’m going to make it slightly different so i’m going to set the y size to be nine and i’m going to wake the zed 4. so as you can see over here now we have a block and this block is pointing north and the thing that makes this block special is that we need to write a bit of code which will make sure that we can place this block in different Directions i’m going to create a texture with ctrl shift d and this is going to be our template texture we’re going to also call this example block let’s click confirm and now we have a texture which we can edit in any program or we can Edit it by clicking on the paint tab so i’m just going to paint on the block a little bit just like so and now that you’ve created your beautiful art we can export it but first we need to add a plugin let’s go to file plugins and search for Voxel shape generator for mcp and mojang mapping and let’s click install then let’s click close and now we can start exporting let’s go to file export and let’s click block slash item model and i’m just going to save this as example dash block dot json and then we want to Go over here and we want to save the texture as example block dot png and i’m going to overwrite the old one that i have next we want to go to file export and we want to export the voxel shape and this is very important because we need to Export it multiple times and we want to always select mojang mappings unless you switch to mcp let’s click confirm and we’re going to name our voxel shape file and this is going to be called north because the object is currently facing north and now we’ve exported our model When it’s facing north now what we want to do is position it in the south direction and then we’re going to once again go to file export voxel shape and we’re going to call this south i’m going to click r and rotate it so that it’s pointing to the side and We’re going to change the position from -16 to zero and now you can see that it is pointing west so let’s file export voxel shape confirm west and then we’re going to move it to the east like so file export voxel shape confirm east now let’s go back into eclipse so let’s Create a new block which is going to be our block that we can rotate so let’s create a public static final registry object of block and this is going to be called rotating block and this is going to be called rotatable block and we’re going to create a new register This is going to take three things so first we’re going to give it the json name which is just going to be rotatable block then we’re going to give it the block and the item and for the item i’m just going to copy the same thing that We have up here like so and for the block we’re going to create a new block block behavior dot properties dot copy and we’re going to copy the properties of a different block so i’m going to use blocks dot dot so this is going to have the same Properties as d and that means the same material and the same material color since we’re using a custom model we’re going to set this to have a dynamic shape because it’s not actually a full block so the rendering will be handled differently i’m also going to give it a Sound type of sound type dot stone however this block is going to need a custom class so in our block package let’s create a new class called rotatable block and once again this extends block press ctrl shift o to import level dot block dot block hover over this add to The constructor delete the to do rename the properties to properties and the same down here and then in our block in it we want to change this block to rotatable block and press ctrl shift o to import that and there we go now we’ve added our rotatable block class and up Here we’re going to create a property so let’s create a public static final direction property and this is going to be called facing i’m going to set it equal to horizontal directional block dot facing and this is a block property which means we can change the block state and therefore block model and Textures depending on what state our block is in so we’ve just added the facing state i’m also going to add an example functionality where my block can be toggled to have light level on and off so i’m going to set the public static final boolean property this is going to Be called lit and we’re going to set it equal to boolean property dot create and we’re going to give it a name of the property so lit there’s lots of different properties that exist and all of them will be slightly different in this line here and maybe later on but I’m just going to use these two default ones to demonstrate how they work next we’re going to overwrite create block state definition and we’re going to change this to builder and instead of the to do we’re going to do builder dot add and we’re going to give it a list of Properties so i’m going to do facing and lit and now our block state will contain the facing and lit properties and you want to make sure to add all your properties to the block state definition next in our constructor we need to set the default state so let’s do this dot Register default state and then we’re going to do this dot default block state dot set value and then we’re going to give a property so facing i’m going to set direction dot north to be the way that it faces and we want to make sure that the direction is net.minecraft.cor.direction we’re also Going to set value lit to be false and this is just going to make sure that the block is not lit by default next let’s add the voxel shapes that we exported so if we open up the text file you can see that we have this voxel shape shape and then we set Shape equal to all of this and we’re just going to copy the bit inside here which has voxel shapes dot box we’re going to copy that and under this we’re going to set public static final voxel shape north is equal to and then and then paste let’s press ctrl Shift o to import both of those and we’re going to change voxel shapes to just block then i’m going to copy and paste this start bit for times for east south and west and then i’m going to repeat opening the text files copying this segment of the code And pasting it adding a semicolon replacing voxel shapes with block and then repeating the next one those are the four voxel shapes in different directions next we’re going to override get shape and for this we get a block state and we need to return the correct Voxel shape that we can use and since we’re actually putting decimals in here we need to replace blocks with shapes like so there we go next we’re going to rename some of the parameters we get here so let’s rename this to state this together this dot pause And this to context then we’re going to write a switch statement for state dot get value for facing then we’re going to hold this and we’re going to add missing case statements and then we want to delete these statements for up and down for east we’re going to return east For north we’re going to return north for south we’re going to return south and for west we’re going to return west and this will select the voxel shape for each direction and we’re just going to set the default voxel shape to also be north and that means we can actually Delete this case north since that will just revert it to the default and there we go now we’re selecting our voxel shape next we need to make sure to correctly rotate the block when it’s placed in the world so we’re going to go down here and override get state for Placement and this is just going to take a context context let’s replace that and in the to do we’re going to return something that isn’t the super we’re going to return this dot default block state dot set value facing and in here we’re going to do context dot get horizontal Direction dot get opposite we’re going to set the correct position when it’s placed finally let’s overwrite two more functions we’re going to overwrite mirror we’re just going to take a state and a mirror and we’re going to return state dot rotate and this is going to take a rotation and That rotation is going to be mirror dot get rotation for state dot get value facing and we’re going to make sure to suppress warnings for deprecation next we want to override rotate and we want to make sure to overwrite the one that has four arguments passed in so the state world Pause and direction and we’re going to return state dot set value facing to direction dot rotate for state dot get value for facing and this is going to apply rotation to our block and that is actually it for our rotation code next let’s add some codes for our lit and we’re going to Copy some of the stuff we wrote over here so let’s just select all of this press ctrl c and paste it down here into our block and what we’re going to do is when it is used if it’s right clicked with a diamond we’re going to toggle the lit state and We’re going to do state dot set value so we’re going to set lit to the opposite of what lit currently is so not state dot get value lit and then we actually need to change the block if it is lit so after properties we can also add stuff to our Properties inside our block and since we need the lit thing over here i’m going to add the light level in our block class instead of the block in it and in the light level function we we get given a state and with it we need to output an integer So what we’re going to do we’re going to output so return and we’re going to return 15 if it’s lit so let’s do state dot get value lit and this is going to return a boolean and if it is lit we’re going to return 15 and if it isn’t lit we’re Going to return zero next we’re going to need to create a custom block state so in source main resources let’s go to assets.tutorial dot block states and create a new block state new file called rotatable block dot json and for now let’s copy over our example block and let’s change the model to Rotatable block however as you can see here we have something for all variants and this isn’t possible when we have a rotatable block or any block with properties so here we have two properties facing and lit and if we open facing you can see that the name for Facing is actually just facing and the name for the boolean is the one we created here so the name for the boolean is lit and that’s going to be important when we write our block state and what we’re going to do is create variants for facing equals north Facing us south east and west we need to make sure to have all the possible values we also need to include lit even though we’re not changing the model so let’s say lit is true and facing is north then we’re going to use this model then let’s copy and paste that three Times changing the north to east south and west and despite the fact that we’re going to be using the same model we’re also going to rotate the model when we’re using it we’re going to rotate all of them on the y-axis so we’re going to add comma y and then the Rotation in degrees and i don’t actually know what this rotation is going to be so i’m going to guess and then we’re going to adjust it afterwards now i’m going to put this to 90 this to 180 and this 2 to 70. so that’s one right angle rotation two right angle Rotations and three right angle rotation and then i’m actually going to copy all of this add a comma and then paste it and we’re going to select all the ones that are highlighters and press ctrl f we’re going to make sure the scope is on selected lines and then we’re going to Replace true with false click replace all and there we go now that we have the exact same models when the state is false now we actually need to create this rotatable block model so let’s go to models block and in here let’s create a new file called rotatable block and now if we Open the exampleblock.json we exported before we can select all of this and paste it in here and we actually forgot to name this adjacent so i’m going to quickly rename that now here we have the credits you can change this to whatever you want the texture size and the textures And since we are using our own textures we need to add our tutorial mod colon this isn’t example block this is rotatable block and we’re going to copy this and paste it for the particle as well since we want to use the same texture there something i didn’t mention during Blockbench is that this item will display weirdly in the inventory to fix that you can go to display and manually set the display stuff or use a preset i’m going to use a preset so i’m going to go over here to apply preset and we’re going to select default block And apply to all slots and now this will behave in an inventory just like a default block we can re-export the block model but this won’t change any other aspects of the model so now that i have this re-exported model i’m going to copy and paste it and then Redo the textures like i did before now we need to drag our texture into the block class so here i have the example block.png so let’s rename that to rotatable block.png and then drag it into the textures.block package let’s go to our lang and quickly add that like so so This is our rotatable block and let’s rename this to rotatable block as well and i’m not going to make any tags because i don’t care that much about the block but now we can start the game and see what happens and when we load in i Forgot to create the item model for the blocks so we’ll do that in a second and you can also see that every time we place the block it’s rotated by 90 degrees so we need to fix that in our block dot item we’re just going to copy The example block and paste it and rename it to rotatable block and inside there we’re going to change the parent to rotatable block again and in our model file we’re going to offset each one by 90 degrees and when we have 270 we’re just going to put zero not 360. Like so now if we go into the game and press f3 and t it’s going to refresh all the assets that are in our package you can see that we now have the item models but now we rotated the things the wrong way so i’m going to put those back That means the first one has to be 270 the second one is going to be zero third one is 90 and the last one is 180. and now if we press f3 and t again we can see that our block is properly rotated and has the hitbox and what we wrote Before in the use function wasn’t actually setting the block state so to fix that what we’re going to do is world dot set block we’re going to give it the position a state and then four and then we’re going to change the state to cycle Lit and what this is going to do is swap the state of lit and then set that in the world and now in our game we can see that if we right click on our block with a diamond we can see that it toggles between emitting light and not emitting Any light next we’re going to talk about render types and this is pretty much always used when we make a custom model let’s right click on our main package let’s go to create a new package this is going to be called client and in here we’re going to add a new class called Client event bus subscriber and at the top we’re going to type at mod dot event bus subscriber we’re going to open brackets we’re going to set the mod id to tutorial mod dot mod id we’re going to set the bus equal to bus dot mod and we’re going to Set the value equal to dist dot client let’s press ctrl shift o to import everything and now in here we need to add an at subscribe event and this is going to be a public static void called client setup which is going to take an fml client Setup event and here we’re going to set up everything that’s to do with the client so all we need to do to add a render layer is to item block render types dot set render layer then we give a block so we can do block init dot Rotatable block dot get and then we can set the render layer so let’s see render type dot and these are all the different render types that we have i’m just going to select cutout which is a simple custom model but you can select anything you want you can also hover Over item block render types and here you can see what each minecraft item and block uses by default and that’s it for our render types we’ll also need this class later when we do a bunch of other client related things next we’re going to go over some more item related things specifically How to make foods and fuels in order to create a fuel we need to overwrite a method inside the item class so in our example item class let’s create a new method which is going to be called get burn time and by default this is going To be -1 which means it doesn’t burn but we can do something like return thousands which is how many ticks this is going to burn for remember that there are 20 seconds per tick so 1 000 ticks is equal to 1000 divided by 20 seconds that’s 50 seconds this is going to burn For 50 seconds and that’s it now our item is a fuel another thing we can do is make our item a food and in order to make it a food we need to add a property in our item in it and this property is called dot food so let’s create a new Food properties dot builder and then here we need to add stuff to our food let’s put dot build at the end and this is going to actually return the build and in between the builder and dot build we can add all the properties for our food We can set always eat so that you can always eat it effects which i’ll cover in a second we can make it a meat we can give it a nutrition value a saturation value and you can make it to be fast to eat once again you can find all the hunger and Saturation values on the minecraft wiki but for the nutrition or hunger i’m gonna put four so four half bars that’s two like full bars of food and then saturation which is how quickly you’ll regenerate after i’m going to set that to 2.0 f if we want to make this food Give an effect you can do dot effect then we give a supplier of a mob effect instance and a probability that this effect will be given i’m going to say that we’re going to give a 100 probability of giving a new mob effect instance and then we’re going to create A mob effect instance next we need a mob effect let’s do mob effect start regeneration next we have the time in ticks so that’s let’s do 200 ticks which is 10 seconds once again divide by 20. and then finally the strength remember the zero is level one regeneration and one is level two Regeneration so i’m going to put this to zero which is going to give us regeneration one for 200 ticks with a 100 percent probability and if we load into the game you can see that our example item can now be used as fuel and it will smelt items for 50 seconds Before eventually running out we can also eat the item now and it’s going to give us regeneration for 10 seconds and it will regenerate four hunger bars and a couple of saturation bars as well next let’s do some tags and some recipes and information for most of this stuff Can actually be found on the minecraft wiki but we’re going to do a little bit anyway we already covered overwriting default minecraft tags last time with the replace values and adding values ourselves we can also create our own tags and this is very similar to before we can go to Tutorial mode and create a new package and let’s call this data.tutorialmods.tags.blocks and this is how we make block tags you can do the exact same thing for item tags if you’d like to let’s create a new file called cool underscore blocks dot json and in here This is going to be very similar to what we had before so we’re going to do replace i’m going to set that equal to false and then we’re going to add our values and inside these square brackets we’re going to put the registry ids of all the cool docs so torment colon block Slash example block that’s a pretty cool block and another cool block is actually minecraft colon block slash diamond ball so now we’re adding our example block and a default minecraft block to a list of cool blocks and if you want to access this tag through code we’re going to need a new Init class so let’s create a new class called tag init and this class is actually a final class so let’s create a public static final class inside the class and this is going to be called blocks and this is going to have all our block tags And then let’s do the exact same thing for items so public static final class items in here let’s create a private static tag dot named and this is going to be of block and we’re going to call this mod and this is going to take a string Path and in here we’re going to return block tags dot bind and a string which is actually going to be a new resource location of tutorial mod dot mod id then the path and then dot to string next let’s copy paste this into the items class over here change this block to item And change this to item tags next let’s register our tag so public static final tag dot named block i’m going to call this cool blocks is equal to mod and the name of the tag is cool underscore blocks now let’s create an item tag so in our tags package let’s delete the Blocks and create a new package called items and you want to make sure that this is plural so it has the s at the end and let’s add a new tag called cool underscore items.json and once again we want to set replace to be false and then we want to Set values to a list of all the cool items i think a cool item is tutorial mod colon example item and minecraft hold on diamond and one thing we did wrong in the blocks is that we don’t need this block slash it will automatically look for block in our tag In it let’s now create a public static final tag dot named of item is going to be called cool underscore items equals mod of cool i items next let’s use these tags somewhere right now to switch the light level on our rotatable block we’re checking if It’s a diamond so instead of all of that we’re going to write tag init dot items since we’re looking for items cool items dot contains and now we need the item so player dot get items in hand so we’re going to get the held item but This is an item stack so we need the item from the item stack and there we go now we can use two different items to toggle our block so now if we run the game now you can see that to enable the light level on our block we can use both A diamond and our example item next let’s cover some recipes and to create a recipe the only thing we need is a json file once again since this is going to be part of a data pack all of the information for this can also be found on the minecraft wiki in our Tutorial mod package let’s create a new package called dot recipes and in here we’re going to add all our recipes so i’m going to create a recipe for all of our stuff so let’s create a new recipe and this is going to be how we craft our Example block and the way we do that is going to be by crafting nine example items together so we’re going to set the type to be crafting shaped since this is a shaped recipe and then we need the pattern and the pattern is going to be three different strings think of these Strings as your crafting table and to put items into that crafting table we need letters so if our recipe is going to be a three by three recipe we’re going to have three rows and we’re going to say look we want to craft nine of our Items together so let’s say our item r is i you can fill this with i just like a crafting rest if you want to have no item here we can put a space and then we’ll have eight items if you only want to craft six items together we can have One row like that and then you can put this at the top or at the bottom of your crafting table same thing with this if we have four you can put this in any place in your crafting table as long as four slots are occupied in this pattern If you want multiple different items you need to use different letters for each item let’s say i want to surround item b with item i then i’d put item b in the middle and put item i everywhere else i’m just going to leave this as them all being i however minecraft doesn’t Actually know what i mean so we have to tell it what it means so to do that we have a key and in this key we’re going to define i is going to be equal to something and then here we can either say something like an item so this is Going to be tutorial mod colon example item or we can set it to a tag so you put a tag something like tutorial mod colon cool items so let’s do that so now any cool item in a 9×9 grid will give our output but now we actually need to define what the output Is so then let’s set the result and the result is always going to be an item which is going to be tutorial mod colon example block and we are going to output only one of those let’s add the missing comma and that is our shaped recipe done Now let’s add a shaped recipe for crafting this example block back into our cool items however over here you can see that we actually have a recipe conflict because the cool items will include diamonds and as we know nine by nine as we know nine diamonds in a grid Is going to give us a diamond block so i’m actually going to remove this to be eight like so that way we don’t have any conflicting recipes i’m now going to add a new recipe called example item dot jason and this time we’re going to use type is equal to crafting Shapeless and this is going to be slightly different you need a list of ingredients so let’s do ingredients is a list and to add an ingredient we can do something like that and once again in here we can do a tag and then the name Of tag or we can do an item i’m just going to do an item for this one so i’m going to do tutorial mod colon example block that’s the item that’s going into the recipe and we only need one of these in any position if you add more Ingredients so something like this that just means you need three example blocks in any position or something like rotatable block means that you need two example blocks and one rotatable block in any position in the crafting table and that will give you the output but i’m just going to stick to one example Block and now we just need the result which is going to be an item of tutorial mod colon example item and i’m going to output eight of them so count is eight and there we go and we want to make sure to put minecraft colon before each Of the names of the types so that we know we’re using a default minecraft type i’m going to quickly cover smelting recipes as well and if you want to see more different recipe types you can always go on the minecraft wiki so let’s create a rotatable block dot json file And this is going to have a type of smelter so now that we have minecraft colon smelting we’re going to need our ingredient and this isn’t going to be a list this is just going to be one thing and we’re just going to use an example block as the single ingredient as always You can use a tag here instead next we’re going to add a result but this time we don’t need a count so this is just going to be on one line so let’s do tutorial mod colon rotatable block but for a furnace we actually need a couple more things We need experience which is the amount of experience given i’m going to set that to naught point two and we need the cooking time in ticks which is how long it’s going to take to smelt the item i’m just going to put 200 ticks and that is Our smelting recipe now we can start the game so in a crafting table we can craft any eight cool items together and we can even mix and match them so i’m going to craft eight diamonds together in this kind of pattern and this is going to Give me an example block which can then be crafted down into eight example items and these can be crafted back into example blocks and if we go over here and we smelt them you can see that after a while we get a rotatable block as an Output which can be turned on and off with our example item which can also be eaten for some reason and that is going to do it for this episode if you need any help join the discord and there are links to the discord the source code for this Video and any useful links in the description in the next episode we’re going to be covering data generators so that you can automate the jsons in your project thank you for watching and i’ll see you next time this was a really long episode You Video Information
This video, titled ‘Minecraft Modding Tutorial 1.18 | #3 – Advanced Blocks + Items’, was uploaded by Cy4’s Modding on 2022-02-13 13:21:55. It has garnered 23116 views and 492 likes. The duration of the video is 00:44:42 or 2682 seconds.
HALLO!! This took so long to edit its crazy 😀 enjoy
(ɔ◔‿◔)ɔ ♥ ~ expand me
C://Help/ Discord: https://discord.gg/x9Mj63m4QG Or comment on this video!
C://MTX/ Get your server today! https://mtxserv.com/ Use codes cy4-3, cy4-6, cy4-16 and cy4-32 for 5% off!
C://Links/ BlockBench: https://www.blockbench.net/ Wiki Hardness: https://minecraft.fandom.com/wiki/Breaking#Blocks_by_hardness Wiki Blast Resistance: https://minecraft.fandom.com/wiki/Explosion#Blast_resistance Wiki Foods: https://minecraft.fandom.com/wiki/Food#Foods Wiki Fuels: https://minecraft.fandom.com/wiki/Smelting#Items_that_can_be_used_as_fuel_in_all_types_of_furnaces Wiki Tags: https://minecraft.fandom.com/wiki/Tag#JSON_format Wiki Recipes: https://minecraft.fandom.com/wiki/Recipe#JSON_format Recipe Generator: https://crafting.thedestruc7i0n.ca/
C://Source_Code/ https://github.com/Cy4Shot/Modding-Tutorial-1.18
C://Follow_Me/ Subscribe: https://www.youtube.com/channel/UCJIDXtGpf4wv1ybDzdTA_vQ/ Website: https://cy4shot.github.io/
C://Time_Stamps/ 00:00 – Intro 00:34 – 1. Advanced Items 05:08 – 2. Block Properties 09:00 – 3. Block Class 12:02 – mtxserv.com 12:25 – 4. Using Blockbench 15:57 – 5. VoxelShapes + Rotation 24:24 – 6. Advanced Blockstates 29:59 – 7. Render Layers 31:38 – 8. Foods + Fuels 34:21 – 9. Block + Item Tags 38:27 – 10. Recipes 44:10 – Outro