<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Making_Blocks%2F1.17</id>
	<title>Making Blocks/1.17 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Making_Blocks%2F1.17"/>
	<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Making_Blocks/1.17&amp;action=history"/>
	<updated>2026-05-01T18:42:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Making_Blocks/1.17&amp;diff=3035&amp;oldid=prev</id>
		<title>ShrimpBot: Copy Making Blocks to MC1.17 archive</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Making_Blocks/1.17&amp;diff=3035&amp;oldid=prev"/>
		<updated>2021-12-06T05:50:49Z</updated>

		<summary type="html">&lt;p&gt;Copy &lt;a href=&quot;/wiki/Making_Blocks&quot; title=&quot;Making Blocks&quot;&gt;Making Blocks&lt;/a&gt; to MC1.17 archive&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Blocks are, obviously, essential to the Minecraft world. They make up all of the terrain, structures, and machines. Chances are if you are interested in making a mod, then you will want to add some blocks. This page will guide you through the creation of blocks, and some of the things you can do with them.&lt;br /&gt;
==Creating a Block==&lt;br /&gt;
===Basic Blocks===&lt;br /&gt;
For simple blocks, which need no special functionality (think cobblestone, wooden planks, etc.), a custom class is not necessary. You can create a block by instantiating the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; class with a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockBehaviour$Properties&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object. This &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockBehaviour$Properties&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; object can be made using &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockBehaviour$Properties::of&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and it can be customised by calling its methods. For instance:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;strength&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - The hardness controls the time it takes to break the block. It is an arbitrary value. For reference, stone has a hardness of 1.5, and dirt 0.5. If the block should be unbreakable a hardness of -1.0 should be used, see the definition of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Blocks#BEDROCK&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; as an example. The resistance controls the explosion resistance of the block. For reference, stone has a resistance of 6.0, and dirt 0.5.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;sound&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Controls the sound the block makes when it is punched, broken, or placed. Requires a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;SoundType&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; argument, see the [[Sounds/1.17|sounds]] page for more details.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;lightLevel&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Controls the light emission of the block. Takes a function with a ''BlockState'' parameter that returns an integer value from zero to fifteen.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;friction&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; - Controls how slippery the block is. For reference, ice has a slipperiness of 0.98.&lt;br /&gt;
&lt;br /&gt;
All these methods are ''chainable'' which means you can call them in series. See the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Blocks&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; class for examples of this.&lt;br /&gt;
&lt;br /&gt;
{{Colored box|title=Tip|content=Blocks have no setter for their &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;CreativeModeTab&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. This has been moved to the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and is now its responsibility.}}&lt;br /&gt;
&lt;br /&gt;
===Advanced Blocks===&lt;br /&gt;
Of course, the above only allows for extremely basic blocks. If you want to add functionality, like player interaction, a custom class is required. However, the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; class has many methods and unfortunately not every single one can be documented here. See the rest of the pages in this section for things you can do with blocks.&lt;br /&gt;
==Registering a Block==&lt;br /&gt;
Blocks must be [[Registration/1.17|registered]] to function.&lt;br /&gt;
&lt;br /&gt;
{{Tip/Important|A block in the level and a &amp;quot;block&amp;quot; in an inventory are very different things. A block in the level is represented by a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockState&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, and its behavior defined by an instance of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Meanwhile, an item in an inventory is an &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemStack&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, controlled by an &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Item&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. As a bridge between the different worlds of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Item&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, there exists the class &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is a subclass of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Item&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; that has a field &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; that holds a reference to the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; it represents. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; defines some of the behavior of a &amp;quot;block&amp;quot; as an item, like how a right click places the block. It's possible to have a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; without an &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. (E.g. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;minecraft:water&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; exists as a block, but not an item. It is therefore impossible to hold it in an inventory as one.)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
When a block is registered, ''only'' a block is registered. The block does not automatically have an &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. To create a basic &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; for a block, one should use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;new BlockItem(block)&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and match the registry name between the two objects. Custom subclasses of &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; may be used as well. Once a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; has been registered for a block, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block#asItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; can be used to retrieve it. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block#asItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; will default to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Items#AIR&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; if there is no &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, so if you are not certain that there is a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; for the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Block&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; you are using, check for &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Items#AIR&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Optionally Registering Blocks====&lt;br /&gt;
Since there is no limit on the amount of blocks that can be register, register all blocks in your mod! If you want a block to be disabled through a configuration file, you should disable the crafting recipe and/or remove the block from the creative menu (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;CreativeModeTab&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;).&lt;br /&gt;
==Further Reading==&lt;br /&gt;
For information about block properties, such as those used for vanilla blocks like fences, walls, and many more, see the section on [[Understanding Blockstates/1.17|blockstates]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Blocks/1.17|Category:Blocks]]&lt;/div&gt;</summary>
		<author><name>ShrimpBot</name></author>
	</entry>
</feed>