MCreator Tutorial: Using procedures for a custom crafting block


Hello everyone, Matt here. Today we are going to create a Fusion Table,
a crafting table like block using the MCreator’s new procedure system. First, we need to create the textures for
the mod. As this is not the focus of this tutorial,
we’ll speed it up. I created all the textures using a free program
called Gimp. We need to draw an arrow for the block’s interface
that will represent the direction of crafting. I decided to go with a dark grey colour with
a slightly lighter upper-left border and a darker bottom-right one to make it look a
bit raised. Then we need to draw the textures for the
block itself. For the bottom part, I simply overlayed some
white noise over the light red colour I used for the base. For the side texture it will be a simple striped
texture with some sort of burning ball on it. For the top, I went with a crafting-table-like
design that resembles the block’s interface. I decided to add a block solely for crafting,
with an iron-block-like design. Now onto the MCreator part. First, we need to add the Red Iron block,
since that’s going to be the base for the machine’s recipe. We need to import every block texture we are
going to use. I decided to prepare the textures for later
by importing them all at once. We now need to set the textures. In the next step, we simply name the cube
and adjust its properties to our likings. Now we create the blocks recipe. I went with an Iron Cube in the middle some
Redstone Powder on each side of it and Redstone Blocks on the top and the bottom side. Now we can create the Fusion Table block. I just set the texture to the side texture
and change the top and bottom ones for the corresponding ones. Now we need to set the blocks name. I’ll go with Fusion Table. Then we adjust the parameters to make the
block a bit special. In this case, I wanted the machine to drop
only 2 blocks of Red Iron. Since the block itself is going to be crafted
out of metal, we can make it sound more realistic by setting the material and sound on step
to IRON and METAL. We don’t need any particles. We need to enable inventory with 3 inventory
slots. Doing so, we enable the block to hold items. And that’s it for the block. Now we need to make a recipe for the Fusion
Table block. I decided to go with 2 Red Iron blocks, 2
TNTs, 2 Brick blocks and a Pressure Plate on the very top. We also need to set the Fusion Table as the
recipe’s result. Now to the most important part – the crafting
procedure. Before we begin, let me introduce you to 2
logic gates AND gate and OR gate. They both take two inputs and output Boolean
values which are either true or false. The AND gate outputs true only if both conditions
are met. OR, however, outputs true when at least one
condition is met. First, we need an IF statement with one AND
gate that contains 1 more AND gate and an OR gate. Now we need 3 block comparators and one number
comparator. The first item/block comparator is going to
check for the first ingredient. In our case that’s always going to be iron. Then we need to check for the second ingredient,
which in this case is Redstone. The number comparator is going to check whether
the output slot is empty since we want to allow crafting new items when the output slot
is empty. The third item/block comparator is going to
check whether the output slot has the same item type as the recipe’s result. Now we need to compare the blocks and items
with the actual slot contents. We can find those blocks under the block actions
tab. Now we add 2 blocks that will remove a single item
from each input slot. After that, we need to increase the number
of items in the output slot by one. We do that by reading the number of items
in the output slot, increasing it by one and setting the new value. We now recommend you check for any potential
mistakes, just like we did. Doing so you can avoid a lot of frustration. If you want, you can now add more recipes
simply by selecting the IF statement and copying it by pressing CTRL+C and pasting it using
CTRL+V. You simply need to change the ingredients in the first 2 item/block comparators, the
output item or block in the third item/block comparator and in the block where we set the
number of items in the output slot. We decided to add recipes for Diamond and
Gold blocks just for demonstration purposes. We now need an interface. First, we bind it to the Fusion Table’s inventory,
then we can open the editor. We can now add the arrow that we created earlier
in the middle of the GUI. Then we add the title. I decided to colour it bright red. Now we can add the slots. Be careful, the order is very important! First, we add the top slot. That’s where the iron blocks will be put. Then we can add the second slot which I coloured
yellow. This one will be used for the second item
which would be Redstone, diamonds and gold. The third slot is going to be used for outputing
items. We colored it bright red. Now we can add the Fuse button with the crafting
procedure bound to it. That way it’s going to craft one item on each
click. We can now click Save Changes and exit the
editor. The last thing we need is to add a procedure
that will open the interface. Go to player management tab and drag the Open
GUI block. Make sure that you select the right GUI if
you have more than one. We now bind the procedure to the “When right
clicked” event on the Fusion Table block. That’s it, all we need to do now is to craft
the table and test it. We need Red Iron, TNT, Brick Blocks and a
pressure plate. As you can see, you can now use the table
to craft the Red Iron, Diamond and Gold blocks. You cannot craft if the items in the output
slot don’t match the result of the current recipe. You can download this mod and its workspace
using the link in the description. Thank you for watching this tutorial, don’t
forget to subscribe, turn on the notifications, like for more content like this and comment
with suggestions down below. Stay tuned!

3 Comments

Add a Comment

Your email address will not be published. Required fields are marked *