User:Umucraft/How to obtain technical blocks as an item

This is a tutorial that shows how to register and obtain technical blocks as an item (Java Edition exclusive) This tutorial is referenced on 1.12.2. The versions 1.13 and onwards uses a completely different system to define items.

At first, you have to set up your environment. You can download MCP from this link: http://www.modcoderpack.com/

After you downloaded, run decompile.bat for decompliation and deobfuscation of Minecraft. Wait it to finish.

Now, decompiled code is outputted in "src" folder. Find net.minecraft.item.Item.

After you found the class, open with a text editor and write this to register nether portal block (to the registerItems field):

registerItemBlock(Blocks.PORTAL);

!! Important: Do not forget to run recompile.bat to apply your changes !!

Run startclient.bat to start the modified client and try this command:

/give @p minecraft:portal

It should give you an item with numerical id #0090 and resource location minecraft:portal. After, try to place. It should place a nether portal block tilted to X axis.

You can register other technical blocks with this method. For example, if you intend to register stationary water ItemBlock, the only difference is the block registry key. In this case, it is "Blocks.WATER".

If you have any kind of problem (such as bugs, crashes etc.) with this tutorial, you can write in my user talk page.