<?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=BlockEntityWithoutLevelRenderer%2F1.17</id>
	<title>BlockEntityWithoutLevelRenderer/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=BlockEntityWithoutLevelRenderer%2F1.17"/>
	<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=BlockEntityWithoutLevelRenderer/1.17&amp;action=history"/>
	<updated>2026-05-01T19:03:26Z</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=BlockEntityWithoutLevelRenderer/1.17&amp;diff=2990&amp;oldid=prev</id>
		<title>ShrimpBot: Copy BlockEntityWithoutLevelRenderer to MC1.17 archive</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=BlockEntityWithoutLevelRenderer/1.17&amp;diff=2990&amp;oldid=prev"/>
		<updated>2021-12-06T05:49:12Z</updated>

		<summary type="html">&lt;p&gt;Copy &lt;a href=&quot;/wiki/BlockEntityWithoutLevelRenderer&quot; title=&quot;BlockEntityWithoutLevelRenderer&quot;&gt;BlockEntityWithoutLevelRenderer&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;&amp;lt;code&amp;gt;BlockEntityWithoutLevelRenderer&amp;lt;/code&amp;gt; is a class that allows custom usages of &amp;lt;code&amp;gt;PoseStack&amp;lt;/code&amp;gt;s and &amp;lt;code&amp;gt;MultiBufferSource&amp;lt;/code&amp;gt;s to render items.&lt;br /&gt;
&lt;br /&gt;
== Using &amp;lt;tt&amp;gt;BlockEntityWithoutLevelRenderer&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&amp;lt;code&amp;gt;BlockEntityWithoutLevelRenderer&amp;lt;/code&amp;gt; allows you to render your item by extending the class and overriding &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockEntityWithoutLevelRenderer#renderByItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In order to use a BEWLR, the Item must first return true for &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BakedModel#isCustomRenderer&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Once that returns true, the Item’s BEWLR will be accessed for rendering. If it does not have one, it will use the default &amp;lt;code&amp;gt;ItemRenderer#getBlockEntityRenderer&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To set the BEWLR for an Item, an anonymous instance of &amp;lt;code&amp;gt;IItemRenderProperties&amp;lt;/code&amp;gt; must be consumed within &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt;. Within the anonymous instance, &amp;lt;code&amp;gt;IItemRenderProperties#getItemStackRenderer&amp;lt;/code&amp;gt; should be overridden to return the instance of your BEWLR:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
// In your item class&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IItemRenderProperties&amp;gt; consumer) {&lt;br /&gt;
  consumer.accept(new IItemRenderProperties() {&lt;br /&gt;
&lt;br /&gt;
    @Override&lt;br /&gt;
    public BlockEntityWithoutLevelRenderer getItemStackRenderer() {&lt;br /&gt;
      return myBEWLRInstance;&lt;br /&gt;
    }&lt;br /&gt;
  });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s it, no additional setup is necessary to use a BEWLR.&lt;br /&gt;
&lt;br /&gt;
{{Tip/Important|Each mod should only have one instance of a BEWLR to render all of their dynamic items.}}&lt;br /&gt;
&lt;br /&gt;
If you need to access the &amp;lt;code&amp;gt;TransformType&amp;lt;/code&amp;gt; for rendering, you can store the one passed through &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BakedModel#handlePerspective&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and use it during rendering. This method will always be called before &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;BlockEntityWithoutLevelRenderer#renderByItem&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Items/1.17|Category:Items]]&lt;/div&gt;</summary>
		<author><name>ShrimpBot</name></author>
	</entry>
</feed>