<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://forge.gemwire.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tmvkrpxl0</id>
	<title>Forge Community Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://forge.gemwire.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tmvkrpxl0"/>
	<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/wiki/Special:Contributions/Tmvkrpxl0"/>
	<updated>2026-05-15T13:45:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Main_Page&amp;diff=3351</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Main_Page&amp;diff=3351"/>
		<updated>2022-10-06T16:25:58Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Adding Hotswap to Other entries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&amp;lt;templatestyles src=&amp;quot;:Main_Page/styles.css&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center title&amp;quot;&amp;gt;Forge Community Wiki&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Forge Community Wiki exists so that the community can:&lt;br /&gt;
&lt;br /&gt;
* collectively keep track of major changes and updates to Forge and Vanilla code;&lt;br /&gt;
* create and edit articles with in-depth explanations about a variety of Forge-related subjects; and&lt;br /&gt;
* contribute example code and tutorials for both simple and difficult concepts.&lt;br /&gt;
&lt;br /&gt;
This wiki is editable by any registered user with an account. This is to allow tracking of harmful edits, but isn't imposing any annoying limits. We welcome any edit, however small. Join the [https://discord.gg/Nn42eAh Discord] to discuss changes and edits to the wiki with others and the staff.&lt;br /&gt;
&lt;br /&gt;
{{Supported versions}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center round_warning&amp;quot;&amp;gt;&lt;br /&gt;
Please read the [[FCWMeta:Wiki Policy|wiki policy]] before editing!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;margin-bottom: 2em&amp;quot;&amp;gt;&lt;br /&gt;
{{Supported versions|text=1}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box_container center&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Beginner Topics&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Getting Started]]&lt;br /&gt;
* [[Proper Mod Structuring]]&lt;br /&gt;
* [[Mods.toml file]]&lt;br /&gt;
* [[Debug Profiler|The Debug Profiler]]&lt;br /&gt;
* [[Version Checker]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Advanced Topics&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Jar-in-jar]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Common Concepts&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Sides|Understanding Sides]]&lt;br /&gt;
* [[Events|Understanding Events]]&lt;br /&gt;
* [[Registration]]&lt;br /&gt;
* [[Internationalization]]&lt;br /&gt;
* [[Configs]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Forge Conventions&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Semantic Versioning]]&lt;br /&gt;
* [[Stages of Modloading]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Resources and Data&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Using Resources|Introduction]]&lt;br /&gt;
* [[Recipes]]&lt;br /&gt;
* [[Tags]]&lt;br /&gt;
* [[Holders]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Blocks&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Making Blocks|Creating Blocks]]&lt;br /&gt;
* [[Understanding Blockstates]] &lt;br /&gt;
* [[Interacting With Blocks|Block Interactions]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Items&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Making Items]]&lt;br /&gt;
* [[Making Tools]]&lt;br /&gt;
* [[BlockEntityWithoutLevelRenderer|&amp;lt;tt&amp;gt;BlockEntityWithoutLevelRenderer&amp;lt;/tt&amp;gt;]]&lt;br /&gt;
* [[Custom Item Animations]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Entities&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Making Entities]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Data Generation&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Datageneration|Introduction]]&lt;br /&gt;
* [[Datageneration/Recipes|Recipes]]&lt;br /&gt;
* [[Datageneration/Tags|Tags]]&lt;br /&gt;
* [[Datageneration/Loot_Tables|Loot Tables]]&lt;br /&gt;
* [[Datageneration/I18n|Localization]]&lt;br /&gt;
* [[Datageneration/States and Models|&amp;lt;tt&amp;gt;BlockState&amp;lt;/tt&amp;gt;s and Models]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Block Entities&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Block Entities|Introduction]]&lt;br /&gt;
* [[Block Entity Renderer|&amp;lt;tt&amp;gt;BlockEntityRenderer&amp;lt;/tt&amp;gt;]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Models&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Introduction to Models|Introduction]]&lt;br /&gt;
* [[Model JSONs]]&lt;br /&gt;
* [[BlockState JSONs]]&lt;br /&gt;
* [[Coloring textures dynamically|Dynamically Colored Textures]]&lt;br /&gt;
* [[Item Properties]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Handling Information&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Understanding Networking|Introduction]]&lt;br /&gt;
* [[Using NBT|Named Binary Tag (NBT)]]&lt;br /&gt;
* [[Using FriendlyByteBuf|Using &amp;lt;tt&amp;gt;FriendlyByteBuf&amp;lt;/tt&amp;gt;]]&lt;br /&gt;
* [[Sending Packets|Sending and Receiving Packets]]&lt;br /&gt;
* [[Using SimpleChannel|Using &amp;lt;tt&amp;gt;SimpleChannel&amp;lt;/tt&amp;gt;]]&lt;br /&gt;
* [[Networking with Entities]]&lt;br /&gt;
* [[DynamicOps|Using DynamicOps]]&lt;br /&gt;
* [[Codecs|Using Codecs]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Data Storage&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Capabilities|Understanding Capabilities]] &lt;br /&gt;
* [[Capabilities/Attaching|Attaching Capabilities]]&lt;br /&gt;
* [[Saved Data]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Game Effects&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Mob Effects]]&lt;br /&gt;
* [[Potions]]&lt;br /&gt;
* [[Particles]]&lt;br /&gt;
* [[Sounds]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Events&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Events|Understanding Events]]&lt;br /&gt;
* [[Entity Events]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Others&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Dependencies]]&lt;br /&gt;
* [[Dynamic Loot Modification]]&lt;br /&gt;
* [[Components|Components and Translation Keys]]&lt;br /&gt;
* [[Key Mappings]]&lt;br /&gt;
* [[Access Transformers]]&lt;br /&gt;
* [[Toolchain]]&lt;br /&gt;
* [[Game_Tests|Game Tests]]&lt;br /&gt;
* [[Biome_Modifiers|Biome Modifiers]]&lt;br /&gt;
* [[Datapack_Registries|Datapack Registries]]&lt;br /&gt;
* [[Hotswap]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Recipes&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Recipes]]&lt;br /&gt;
* [[Custom Recipes|Custom Recipe Types]]&lt;br /&gt;
* [[Datageneration/Recipes|Datageneration]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Hotswap&amp;diff=3350</id>
		<title>Hotswap</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Hotswap&amp;diff=3350"/>
		<updated>2022-10-06T16:14:01Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Under construction}} &amp;lt;!-- Guide for other IDEs is missing --&amp;gt; &lt;br /&gt;
== What is Hot-swapping? ==&lt;br /&gt;
Hot-swapping is a feature letting you to swap-out code of your mod without restarting game, allowing you to see changes quickly and tinker around with it more easily.&lt;br /&gt;
&lt;br /&gt;
In this article, we will also be covering how to swap resources so that you can change models and textures, and see it in-game quickly.&lt;br /&gt;
&lt;br /&gt;
== Swapping resources ==&lt;br /&gt;
=== Swapping resources on Intellij Idea ===&lt;br /&gt;
After you made changes to resource file, hit this &amp;quot;hammer icon&amp;quot;, or build button.&lt;br /&gt;
[[File:Intellij_idea_menu_for_hot_swap_doc.png]]&lt;br /&gt;
After that, hit F3+T if resources you changed are assets. It's a shortcut-key for reloading assets.&lt;br /&gt;
If they're data pack, use /datapack command to disable and then re-enable data pack of your mod.&lt;br /&gt;
&lt;br /&gt;
== Hot-swapping code ==&lt;br /&gt;
You can also swap out code if only method's internal has been changed. You would still need to restart game if you added/removed/renamed method/variable/class. This change is called &amp;quot;schema change&amp;quot;, and guide for applying schema change is in below section.&lt;br /&gt;
&lt;br /&gt;
Ensure that you are running the game on debug mode in IDE. It is usually indicated by green bug-shaped icon.&lt;br /&gt;
[[File:Debugmodeintellij.png]]&lt;br /&gt;
=== Hot-swapping code on Intellij Idea ===&lt;br /&gt;
It's more simple than swapping out resources. After making changes to the code, just hit the build button. Then It will show you this message on bottom-left corner. If your mod project is big and it takes a long time to do so, hit &amp;lt;code&amp;gt;Build -&amp;gt; Recompile &amp;quot;currently opened file's name&amp;quot;&amp;lt;/code&amp;gt;, this will only recompile file that is currently open. This option will not be visible if you don't have compile-able file opened. Files with extensions such as &amp;lt;code&amp;gt;.java&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.kt&amp;lt;/code&amp;gt; are compile-able.&lt;br /&gt;
[[File:Hotswapmessage.png]]&lt;br /&gt;
If you changed class's schematics then will show you error messages saying it is unsupported. Head to Applying schema changes section if you need to change schematics.&lt;br /&gt;
&lt;br /&gt;
=== Applying schema changes ===&lt;br /&gt;
This requires more setup and specific JDK, Jetbrains Runtime (JBR).&lt;br /&gt;
But it will greatly accelerate development process and make tinkering easier by allowing you to:&lt;br /&gt;
* Create/Remove classes&lt;br /&gt;
* Add/Rename/Remove variables/methods&lt;br /&gt;
* Change value of final constants&lt;br /&gt;
All without restarting the game.&lt;br /&gt;
&lt;br /&gt;
The reason why JBR is suggested over other JDKs is that it has [https://dcevm.github.io/ DCEVM](It allows class schema change in debug mode) by default and requires less configuration, such as hot-swap agent and IDE-specific plugins, etc. Although, there isn't exactly &amp;quot;installer&amp;quot; for it, you would have to download and unpack it manually.&lt;br /&gt;
&lt;br /&gt;
==== Downloading JBR ====&lt;br /&gt;
Download JBR with right java version and platform from here: https://github.com/JetBrains/JetBrainsRuntime/releases&lt;br /&gt;
There are many different &amp;quot;flavors&amp;quot; but I recommend you downloading &amp;quot;JBR (vanilla)&amp;quot; one if you don't know what these are.&lt;br /&gt;
After downloading has finished unpack it into suitable location&lt;br /&gt;
&lt;br /&gt;
==== Adding JDK to IDE ====&lt;br /&gt;
===== Adding JDK to Intellij Idea =====&lt;br /&gt;
Go to File -&amp;gt; Project Structure -&amp;gt; Project -&amp;gt; SDK -&amp;gt; Add JDK&lt;br /&gt;
and then select directory you've unpacked JBR into.&lt;br /&gt;
After that, It is recommended to choose JBR as project SDK if you're not familiar with gradle and Intellij's run configs&lt;br /&gt;
[[File:Addjdk.png]]&lt;br /&gt;
&lt;br /&gt;
==== Changing run configuration ====&lt;br /&gt;
Open build.gradle file and then add &amp;lt;code&amp;gt;jvmArg &amp;quot;-XX:+AllowEnhancedClassRedefinition&amp;quot;&amp;lt;/code&amp;gt; to desired run configuration. below is example for adding it into &amp;lt;code&amp;gt;runClient&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;groovy&amp;quot;&amp;gt;&lt;br /&gt;
runs {&lt;br /&gt;
    client {&lt;br /&gt;
        workingDirectory project.file('run')&lt;br /&gt;
        jvmArg &amp;quot;-XX:+AllowEnhancedClassRedefinition&amp;quot;&lt;br /&gt;
        property 'forge.logging.markers', 'REGISTRIES'&lt;br /&gt;
        property 'forge.logging.console.level', 'debug'&lt;br /&gt;
        property 'forge.enabledGameTestNamespaces', 'examplemod'&lt;br /&gt;
        mods {&lt;br /&gt;
            examplemod {&lt;br /&gt;
                source sourceSets.main&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Final step ====&lt;br /&gt;
===== Final configuration for Intellij Idea =====&lt;br /&gt;
Go to &amp;lt;code&amp;gt;File -&amp;gt; Settings -&amp;gt; Build, Execution, Deployment -&amp;gt; Build Tools -&amp;gt; Gradle&amp;lt;/code&amp;gt;, and use Intellij Idea for running and building and testing&lt;br /&gt;
[[File:Gradleintellij.png]]&lt;br /&gt;
&lt;br /&gt;
Then re-generate run configurations by running &amp;lt;code&amp;gt;genIntellijRuns&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! Now launch one of these on debug mode and you can now change classes' schematic as much as you want, and then hit build button. it will swap those just fine.&lt;br /&gt;
[[File:Runconfigs.png]]&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Hotswap&amp;diff=3349</id>
		<title>Hotswap</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Hotswap&amp;diff=3349"/>
		<updated>2022-10-06T15:36:07Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Under construction}} &amp;lt;!-- Guide for other IDEs is missing --&amp;gt; &lt;br /&gt;
== What is Hot-swapping? ==&lt;br /&gt;
Hot-swapping is a feature letting you to swap-out parts of game without restarting it, allowing you to see resources and code changes quickly and tinker around with it more easily.&lt;br /&gt;
&lt;br /&gt;
{{Tip|It is recommended that you run the game with debug mode in order to use hot-swapping, as code changes will only get applied under debug mode.}}&lt;br /&gt;
&lt;br /&gt;
== Hot-swapping resources ==&lt;br /&gt;
=== Hot-swapping resources on Intellij Idea ===&lt;br /&gt;
After you made changes to resource file, hit this &amp;quot;hammer icon&amp;quot;, or build button.&lt;br /&gt;
[[File:Intellij_idea_menu_for_hot_swap_doc.png]]&lt;br /&gt;
After that, hit F3+T if resources you changed are assets. It's a shortcut-key for reloading assets.&lt;br /&gt;
If they're data pack, use /datapack command to disable and then re-enable data pack of your mod.&lt;br /&gt;
&lt;br /&gt;
== Hot-swapping code ==&lt;br /&gt;
You can also swap out code if only method's internal has been changed. You would still need to restart game if you added/removed/renamed method/variable/class. This change is called &amp;quot;schema change&amp;quot;, and guide for applying schema change is in below section.&lt;br /&gt;
&lt;br /&gt;
Ensure that you are running the game on debug mode in IDE. It is usually indicated by green bug-shaped icon.&lt;br /&gt;
[[File:Debugmodeintellij.png]]&lt;br /&gt;
=== Hot-swapping code on Intellij Idea ===&lt;br /&gt;
It's more simple than hot-swapping resources. After making changes to the code, just hit the build button. Then It will show you this message on bottom-left corner. If your mod project is big and it takes a long time to do so, hit &amp;lt;code&amp;gt;Build -&amp;gt; Recompile &amp;quot;currently opened file's name&amp;quot;&amp;lt;/code&amp;gt;, this will only recompile file that is currently open. This option will not be visible if you don't have compile-able file opened. Files with extensions such as &amp;lt;code&amp;gt;.java&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.kt&amp;lt;/code&amp;gt; are compile-able.&lt;br /&gt;
[[File:Hotswapmessage.png]]&lt;br /&gt;
If you changed class's schematics then will show you error messages saying it is unsupported. Head to Applying schema changes section if you need to change schematics.&lt;br /&gt;
&lt;br /&gt;
=== Applying schema changes ===&lt;br /&gt;
This requires more setup and specific find of JDK, Jetbrains Runtime (JBR). The reason why JBR is suggested is that it has [https://dcevm.github.io/ DCEVM](It allows class schema change in debug mode) by default and requires less configuration than other JDKs, such as hot-swap agent and IDE-specific plugins, etc. Although, there isn't exactly &amp;quot;installer&amp;quot; for it, you would have to download and unpack it manually.&lt;br /&gt;
&lt;br /&gt;
==== Downloading JBR ====&lt;br /&gt;
Download JBR with right java version and platform from here: https://github.com/JetBrains/JetBrainsRuntime/releases&lt;br /&gt;
There are many different &amp;quot;flavors&amp;quot; but I recommend you downloading &amp;quot;JBR (vanilla)&amp;quot; one if you don't know what are these.&lt;br /&gt;
After downloading has finished unpack it into suitable location&lt;br /&gt;
&lt;br /&gt;
==== Adding JDK to IDE ====&lt;br /&gt;
===== Adding JDK to Intellij Idea =====&lt;br /&gt;
Go to File -&amp;gt; Project Structure -&amp;gt; Project -&amp;gt; SDK -&amp;gt; Add JDK&lt;br /&gt;
and then select directory you've unpacked JBR into.&lt;br /&gt;
After that, It is recommended to choose JBR as project SDK if you're not familiar with gradle and Intellij's run configs&lt;br /&gt;
[[File:Addjdk.png]]&lt;br /&gt;
&lt;br /&gt;
==== Changing run configuration ====&lt;br /&gt;
Open build.gradle file and then add &amp;lt;code&amp;gt;jvmArg &amp;quot;-XX:+AllowEnhancedClassRedefinition&amp;quot;&amp;lt;/code&amp;gt; to desired run configuration. below is example for adding it into &amp;lt;code&amp;gt;runClient&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;groovy&amp;quot;&amp;gt;&lt;br /&gt;
runs {&lt;br /&gt;
    client {&lt;br /&gt;
        workingDirectory project.file('run')&lt;br /&gt;
        jvmArg &amp;quot;-XX:+AllowEnhancedClassRedefinition&amp;quot;&lt;br /&gt;
        property 'forge.logging.markers', 'REGISTRIES'&lt;br /&gt;
        property 'forge.logging.console.level', 'debug'&lt;br /&gt;
        property 'forge.enabledGameTestNamespaces', 'examplemod'&lt;br /&gt;
        mods {&lt;br /&gt;
            examplemod {&lt;br /&gt;
                source sourceSets.main&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Final step ====&lt;br /&gt;
===== Final configuration for Intellij Idea =====&lt;br /&gt;
Go to &amp;lt;code&amp;gt;File -&amp;gt; Settings -&amp;gt; Build, Execution, Deployment -&amp;gt; Build Tools -&amp;gt; Gradle&amp;lt;/code&amp;gt;, and use Intellij Idea for running and building and testing&lt;br /&gt;
[[File:Gradleintellij.png]]&lt;br /&gt;
&lt;br /&gt;
Then re-generate run configurations by running &amp;lt;code&amp;gt;genIntellijRuns&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! Now launch one of these on debug mode and you can now change classes' schematic as much as you want, it will swap those just fine.&lt;br /&gt;
[[File:Runconfigs.png]]&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Hotswap&amp;diff=3348</id>
		<title>Hotswap</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Hotswap&amp;diff=3348"/>
		<updated>2022-10-06T15:18:01Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Under construction}} &amp;lt;!-- Guide for other IDEs is missing --&amp;gt; &lt;br /&gt;
== What is Hot-swapping? ==&lt;br /&gt;
Hot-swapping is a feature letting you to see code/resource changes in-game without restarting it.&lt;br /&gt;
&lt;br /&gt;
{{Tip|It is recommended that you run the game with debug mode in order to use hot-swapping, as code changes will only get applied under debug mode.}}&lt;br /&gt;
&lt;br /&gt;
== Hot-swapping resources ==&lt;br /&gt;
=== Hot-swapping resources on Intellij Idea ===&lt;br /&gt;
After you made changes to resource file, hit this &amp;quot;hammer icon&amp;quot;, or build button.&lt;br /&gt;
[[File:Intellij_idea_menu_for_hot_swap_doc.png]]&lt;br /&gt;
After that, hit F3+T if resources you changed are assets. It's a shortcut-key for reloading assets.&lt;br /&gt;
If they're data pack, use /datapack command to disable and then re-enable data pack of your mod.&lt;br /&gt;
&lt;br /&gt;
== Hot-swapping code ==&lt;br /&gt;
You can also swap out code if only method's internal has been changed. You would still need to restart game if you added/removed/renamed method/variable/class. This change is called &amp;quot;schema change&amp;quot;, and guide for applying schema change is in below section.&lt;br /&gt;
&lt;br /&gt;
Ensure that you are running the game on debug mode in IDE. It is usually indicated by green bug-shaped icon.&lt;br /&gt;
[[File:Debugmodeintellij.png]]&lt;br /&gt;
=== Hot-swapping code on Intellij Idea ===&lt;br /&gt;
It's more simple then hot-swapping resources. After making changes to the code, just hit the build button. Then It will show you this message on bottom-left corner. If your mod project is big and it takes a long time to do so, hit &amp;lt;code&amp;gt;Build -&amp;gt; Recompile &amp;quot;currently opened file's name&amp;quot;&amp;lt;/code&amp;gt;, this will only recompile file that is currently open. This option will not be visible if you don't have compile-able file opened. Files with extensions such as &amp;lt;code&amp;gt;.java&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.kt&amp;lt;/code&amp;gt; are compile-able.&lt;br /&gt;
[[File:Hotswapmessage.png]]&lt;br /&gt;
If you changed class's schematics then will show you error messages saying it is unsupported. Head to Applying schema changes section if you need to change schematics.&lt;br /&gt;
&lt;br /&gt;
=== Applying schema changes ===&lt;br /&gt;
This requires more setup and specific find of JDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Downloading JBR ====&lt;br /&gt;
Download Jetbrain runtime(JBR) with right java version and platform from here: https://github.com/JetBrains/JetBrainsRuntime/releases&lt;br /&gt;
There are many different &amp;quot;flavors&amp;quot; but I recommend you downloading &amp;quot;JBR (vanilla)&amp;quot; one if you don't know what are these.&lt;br /&gt;
After downloading has finished unpack it into suitable location&lt;br /&gt;
&lt;br /&gt;
==== Adding JDK to IDE ====&lt;br /&gt;
===== Adding JDK to Intellij Idea =====&lt;br /&gt;
Go to File -&amp;gt; Project Structure -&amp;gt; Project -&amp;gt; SDK -&amp;gt; Add JDK&lt;br /&gt;
and then select directory you've unpacked JBR into.&lt;br /&gt;
After that, It is recommended to choose JBR as project SDK if you're not familiar with gradle and Intellij's run configs&lt;br /&gt;
[[File:Addjdk.png]]&lt;br /&gt;
&lt;br /&gt;
==== Changing run configuration ====&lt;br /&gt;
Open build.gradle file and then add &amp;lt;code&amp;gt;jvmArg &amp;quot;-XX:+AllowEnhancedClassRedefinition&amp;quot;&amp;lt;/code&amp;gt; to desired run configuration. below is example for adding it into &amp;lt;code&amp;gt;runClient&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;groovy&amp;quot;&amp;gt;&lt;br /&gt;
runs {&lt;br /&gt;
    client {&lt;br /&gt;
        workingDirectory project.file('run')&lt;br /&gt;
        jvmArg &amp;quot;-XX:+AllowEnhancedClassRedefinition&amp;quot;&lt;br /&gt;
        property 'forge.logging.markers', 'REGISTRIES'&lt;br /&gt;
        property 'forge.logging.console.level', 'debug'&lt;br /&gt;
        property 'forge.enabledGameTestNamespaces', 'examplemod'&lt;br /&gt;
        mods {&lt;br /&gt;
            examplemod {&lt;br /&gt;
                source sourceSets.main&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Final step ====&lt;br /&gt;
===== Final configuration for Intellij Idea =====&lt;br /&gt;
Go to &amp;lt;code&amp;gt;File -&amp;gt; Settings -&amp;gt; Build, Execution, Deployment -&amp;gt; Build Tools -&amp;gt; Gradle&amp;lt;/code&amp;gt;, and use Intellij Idea for running and building and testing&lt;br /&gt;
[[File:Gradleintellij.png]]&lt;br /&gt;
&lt;br /&gt;
Then re-generate run configurations by running &amp;lt;code&amp;gt;genIntellijRuns&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! Now launch one of these on debug mode and you can now change classes' schematic as much as you want, it will swap those just fine.&lt;br /&gt;
[[File:Runconfigs.png]]&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=File:Runconfigs.png&amp;diff=3347</id>
		<title>File:Runconfigs.png</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=File:Runconfigs.png&amp;diff=3347"/>
		<updated>2022-10-06T14:58:09Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Image listing run configs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Image listing run configs&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=File:Gradleintellij.png&amp;diff=3346</id>
		<title>File:Gradleintellij.png</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=File:Gradleintellij.png&amp;diff=3346"/>
		<updated>2022-10-06T14:27:12Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Image describing how to use Intellij instead of gradle to running the game.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Image describing how to use Intellij instead of gradle to running the game.&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=File:Addjdk.png&amp;diff=3345</id>
		<title>File:Addjdk.png</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=File:Addjdk.png&amp;diff=3345"/>
		<updated>2022-10-06T14:13:51Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Image describing how to add new jdk&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Image describing how to add new jdk&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=File:Hotswapmessage.png&amp;diff=3344</id>
		<title>File:Hotswapmessage.png</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=File:Hotswapmessage.png&amp;diff=3344"/>
		<updated>2022-10-06T13:53:26Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Image describing what message is displayed after hotswap.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Image describing what message is displayed after hotswap.&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=File:Debugmodeintellij.png&amp;diff=3343</id>
		<title>File:Debugmodeintellij.png</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=File:Debugmodeintellij.png&amp;diff=3343"/>
		<updated>2022-10-06T13:49:35Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Image describing indicator of debug mode.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Image describing indicator of debug mode.&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=File:Intellij_idea_menu_for_hot_swap_doc.png&amp;diff=3342</id>
		<title>File:Intellij idea menu for hot swap doc.png</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=File:Intellij_idea_menu_for_hot_swap_doc.png&amp;diff=3342"/>
		<updated>2022-10-06T13:42:27Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Image describing which button is the build button&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Image describing which button is the build button&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Hotswap&amp;diff=3341</id>
		<title>Hotswap</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Hotswap&amp;diff=3341"/>
		<updated>2022-10-06T13:32:41Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Guide about hot-swapping both code and resources&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What even is this? ==&lt;br /&gt;
Hot-swapping is a feature letting you to see code/resource changes in-game without restarting it.&lt;br /&gt;
This article is divided into 2 sections: Basic hot-swapping and schema change hot-swapping, as latter one requires more setup.&lt;br /&gt;
&lt;br /&gt;
==  Basic hot-swapping ==&lt;br /&gt;
Here, you would be able to swap out resource pack/data pack of your mod without restarting the game. You can also swap out code if only method's internal has been changed. You would still need to restart game if you added/removed/renamed method/variable/class.&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Main_Page&amp;diff=3319</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Main_Page&amp;diff=3319"/>
		<updated>2022-09-04T14:20:30Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&amp;lt;templatestyles src=&amp;quot;:Main_Page/styles.css&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center title&amp;quot;&amp;gt;Forge Community Wiki&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Forge Community Wiki exists so that the community can:&lt;br /&gt;
&lt;br /&gt;
* collectively keep track of major changes and updates to Forge and Vanilla code;&lt;br /&gt;
* create and edit articles with in-depth explanations about a variety of Forge-related subjects; and&lt;br /&gt;
* contribute example code and tutorials for both simple and difficult concepts.&lt;br /&gt;
&lt;br /&gt;
This wiki is editable by any registered user with an account. This is to allow tracking of harmful edits, but isn't imposing any annoying limits. We welcome any edit, however small. Join the [https://discord.gg/Nn42eAh Discord] to discuss changes and edits to the wiki with others and the staff.&lt;br /&gt;
&lt;br /&gt;
{{Supported versions}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center round_warning&amp;quot;&amp;gt;&lt;br /&gt;
Please read the [[FCWMeta:Wiki Policy|wiki policy]] before editing!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;margin-bottom: 2em&amp;quot;&amp;gt;&lt;br /&gt;
{{Supported versions|text=1}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box_container center&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Beginner Topics&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Getting Started]]&lt;br /&gt;
* [[Proper Mod Structuring]]&lt;br /&gt;
* [[Mods.toml file]]&lt;br /&gt;
* [[Debug Profiler|The Debug Profiler]]&lt;br /&gt;
* [[Version Checker]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Advanced Topics&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Jar-in-jar]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Common Concepts&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Sides|Understanding Sides]]&lt;br /&gt;
* [[Events|Understanding Events]]&lt;br /&gt;
* [[Registration]]&lt;br /&gt;
* [[Internationalization]]&lt;br /&gt;
* [[Configs]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Forge Conventions&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Semantic Versioning]]&lt;br /&gt;
* [[Stages of Modloading]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Resources and Data&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Using Resources|Introduction]]&lt;br /&gt;
* [[Recipes]]&lt;br /&gt;
* [[Tags]]&lt;br /&gt;
* [[Holders]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Blocks&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Making Blocks|Creating Blocks]]&lt;br /&gt;
* [[Understanding Blockstates]] &lt;br /&gt;
* [[Interacting With Blocks|Block Interactions]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Items&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Making Items]]&lt;br /&gt;
* [[Making Tools]]&lt;br /&gt;
* [[BlockEntityWithoutLevelRenderer|&amp;lt;tt&amp;gt;BlockEntityWithoutLevelRenderer&amp;lt;/tt&amp;gt;]]&lt;br /&gt;
* [[Custom Item Animations]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Data Generation&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Datageneration|Introduction]]&lt;br /&gt;
* [[Datageneration/Recipes|Recipes]]&lt;br /&gt;
* [[Datageneration/Tags|Tags]]&lt;br /&gt;
* [[Datageneration/Loot_Tables|Loot Tables]]&lt;br /&gt;
* [[Datageneration/I18n|Localization]]&lt;br /&gt;
* [[Datageneration/States and Models|&amp;lt;tt&amp;gt;BlockState&amp;lt;/tt&amp;gt;s and Models]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Block Entities&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Block Entities|Introduction]]&lt;br /&gt;
* [[Block Entity Renderer|&amp;lt;tt&amp;gt;BlockEntityRenderer&amp;lt;/tt&amp;gt;]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Models&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Introduction to Models|Introduction]]&lt;br /&gt;
* [[Model JSONs]]&lt;br /&gt;
* [[BlockState JSONs]]&lt;br /&gt;
* [[Coloring textures dynamically|Dynamically Colored Textures]]&lt;br /&gt;
* [[Item Properties]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Handling Information&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Understanding Networking|Introduction]]&lt;br /&gt;
* [[Using NBT|Named Binary Tag (NBT)]]&lt;br /&gt;
* [[Using FriendlyByteBuf|Using &amp;lt;tt&amp;gt;FriendlyByteBuf&amp;lt;/tt&amp;gt;]]&lt;br /&gt;
* [[Sending Packets|Sending and Receiving Packets]]&lt;br /&gt;
* [[Using SimpleChannel|Using &amp;lt;tt&amp;gt;SimpleChannel&amp;lt;/tt&amp;gt;]]&lt;br /&gt;
* [[Networking with Entities]]&lt;br /&gt;
* [[DynamicOps|Using DynamicOps]]&lt;br /&gt;
* [[Codecs|Using Codecs]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Data Storage&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Capabilities|Understanding Capabilities]] &lt;br /&gt;
* [[Capabilities/Attaching|Attaching Capabilities]]&lt;br /&gt;
* [[Saved Data]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Game Effects&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Mob Effects]]&lt;br /&gt;
* [[Potions]]&lt;br /&gt;
* [[Particles]]&lt;br /&gt;
* [[Sounds]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Events&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Events|Understanding Events]]&lt;br /&gt;
* [[Entity Events]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Others&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Dependencies]]&lt;br /&gt;
* [[Dynamic Loot Modification]]&lt;br /&gt;
* [[Components|Components and Translation Keys]]&lt;br /&gt;
* [[Key Mappings]]&lt;br /&gt;
* [[Access Transformers]]&lt;br /&gt;
* [[Toolchain]]&lt;br /&gt;
* [[Game_Tests|Game Tests]]&lt;br /&gt;
* [[Biome_Modifiers|Biome Modifiers]]&lt;br /&gt;
* [[Datapack_Registries|Datapack Registries]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Recipes&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Recipes]]&lt;br /&gt;
* [[Custom Recipes|Custom Recipe Types]]&lt;br /&gt;
* [[Datageneration/Recipes|Datageneration]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Custom_Item_Animations&amp;diff=3318</id>
		<title>Custom Item Animations</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Item_Animations&amp;diff=3318"/>
		<updated>2022-09-04T10:46:09Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Custom Item animation allows items to have both 3rd person and 1st person animation. This is done by consuming custom client extension with custom rendering logic in &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Defining custom client extension ==&lt;br /&gt;
First, create a implementation of &amp;lt;code&amp;gt;IClientItemExtensions&amp;lt;/code&amp;gt;. It can be either anonymous or named.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
IClientItemExtensions extension = new IClientItemExtensions() {&lt;br /&gt;
// .....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An instance of it should be consumed in &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt; like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(extension);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or you can define and consume implementation at same time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
    // .....&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;Implementing first person Item Animation&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
In order to implmement first person Item Animation in &amp;lt;code&amp;gt;IClientItemExtensions&amp;lt;/code&amp;gt;, override &amp;lt;code&amp;gt;#applyForgeHandTransform&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
IClientItemExtensions extension = new IClientItemExtensions() {&lt;br /&gt;
    @Override&lt;br /&gt;
    public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
    // Returning true in this method is recommended as it will prevent this item stack from being handled by vanilla rendering system, preventing additional unwanted transformations from being applied.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;applyForgeHandTransform&amp;lt;/code&amp;gt; method's parameters are for:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;PoseStack poseStack&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: For stacking matrix poses. You can translate, rotate, scale item model with it.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;LocalPlayer player&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Main client player holding the item.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;HumanoidArm arm&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: For distinguishing which arm is holding the item. It's either &amp;lt;code&amp;gt;#LEFT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;#RIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemStack itemInHand&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt; that player is holding. Its &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is always the custom &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; that you're implementing animation for.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float partialTick&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0 for telling how much time has passed since last tick. If it's close to 0.0, it means current tick just started. If it's close to 1.0, it means current tick is almost over.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float equipProcess&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0. It's close to 0.0 when the sword gauge bar is full. It's close to 1.0 when sword gauge bar is low. [[File:That_short_gage_thing_under_cross.png]]&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float swingProcess&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0 for telling animation progress. If it's exactly at 0.0, the animation is not playing. If it's just close to 0.0, animation has just started playing. If it's close to 1.0, the animation is almost over.&lt;br /&gt;
&lt;br /&gt;
Here's example implementation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
        @Override&lt;br /&gt;
         public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
            int i = arm == HumanoidArm.RIGHT ? 1 : -1;&lt;br /&gt;
            poseStack.translate(i * 0.56F, -0.52F, -0.72F);&lt;br /&gt;
             if (player.getUseItem() == itemInHand &amp;amp;&amp;amp; player.isUsingItem()) {&lt;br /&gt;
                poseStack.translate(0.0, -0.05, 0.0);&lt;br /&gt;
            }&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;Implementing third person Item Animation&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
Implementing third person Item Animation is done via defining custom &amp;lt;code&amp;gt;HumanoidModel$ArmPose&amp;lt;/code&amp;gt; and returning it in &amp;lt;code&amp;gt;IClientItemExtensions#getArmPose&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Defining custom ArmPose ===&lt;br /&gt;
Forge makes &amp;lt;code&amp;gt;HumanoidModel$ArmPose&amp;lt;/code&amp;gt; enum extensible, allowing you to create custom entries using &amp;lt;code&amp;gt;HumanoidModel$ArmPose#create&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
private static final HumanoidModel.ArmPose EXAMPLE_POSE = HumanoidModel.ArmPose.create(&amp;quot;EXAMPLE&amp;quot;, false, (model, entity, arm) -&amp;gt; {&lt;br /&gt;
    if (arm == HumanoidArm.RIGHT) {&lt;br /&gt;
        model.rightArm.xRot = (float) (Math.random() * Math.PI * 2);&lt;br /&gt;
    } else {&lt;br /&gt;
        model.leftArm.xRot = (float) (Math.random() * Math.PI * 2);&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; takes in 3 arguments:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;String name&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Name of the custom pose.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;boolean twoHanded&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Whether or not the animation should be two handed or single handed.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;IArmPoseTransformer forgeArmPose&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Functional interface for custom arm rendering logic.&lt;br /&gt;
&lt;br /&gt;
after that, override &amp;lt;code&amp;gt;IClientItemExtensions#getArmPose&amp;lt;/code&amp;gt; so that it returns newly created enum entry.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public HumanoidModel.ArmPose getArmPose(LivingEntity entityLiving, InteractionHand hand, ItemStack itemStack) {&lt;br /&gt;
    if (!itemStack.isEmpty()) {&lt;br /&gt;
        if (entityLiving.getUsedItemHand() == hand &amp;amp;&amp;amp; entityLiving.getUseItemRemainingTicks() &amp;gt; 0) {&lt;br /&gt;
            return EXAMPLE_POSE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return HumanoidModel.ArmPose.EMPTY;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It has additional check to ensure only play custom arm rendering logic when player is actually using this item.&lt;br /&gt;
&lt;br /&gt;
== Tying it all up ==&lt;br /&gt;
Combining both examples into single &amp;lt;code&amp;gt;IClientItemExtensions&amp;lt;/code&amp;gt; would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer)&lt;br /&gt;
{&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
&lt;br /&gt;
        private static final HumanoidModel.ArmPose EXAMPLE_POSE = HumanoidModel.ArmPose.create(&amp;quot;EXAMPLE&amp;quot;, false, (model, entity, arm) -&amp;gt; {&lt;br /&gt;
            if (arm == HumanoidArm.RIGHT) {&lt;br /&gt;
                model.rightArm.xRot = (float) (Math.random() * Math.PI * 2);&lt;br /&gt;
            } else {&lt;br /&gt;
                model.leftArm.xRot = (float) (Math.random() * Math.PI * 2);&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        @Override&lt;br /&gt;
        public HumanoidModel.ArmPose getArmPose(LivingEntity entityLiving, InteractionHand hand, ItemStack itemStack) {&lt;br /&gt;
            if (!itemStack.isEmpty()) {&lt;br /&gt;
                if (entityLiving.getUsedItemHand() == hand &amp;amp;&amp;amp; entityLiving.getUseItemRemainingTicks() &amp;gt; 0) {&lt;br /&gt;
                    return EXAMPLE_POSE;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            return HumanoidModel.ArmPose.EMPTY;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        @Override&lt;br /&gt;
        public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
            int i = arm == HumanoidArm.RIGHT ? 1 : -1;&lt;br /&gt;
            poseStack.translate(i * 0.56F, -0.52F, -0.72F);&lt;br /&gt;
            if (player.getUseItem() == itemInHand &amp;amp;&amp;amp; player.isUsingItem()) {&lt;br /&gt;
                poseStack.translate(0.0, -0.05, 0.0);&lt;br /&gt;
            }&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Items]]&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Custom_Item_Animations&amp;diff=3317</id>
		<title>Custom Item Animations</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Item_Animations&amp;diff=3317"/>
		<updated>2022-09-04T10:45:54Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Under construction}}&lt;br /&gt;
Custom Item animation allows items to have both 3rd person and 1st person animation. This is done by consuming custom client extension with custom rendering logic in &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Defining custom client extension ==&lt;br /&gt;
First, create a implementation of &amp;lt;code&amp;gt;IClientItemExtensions&amp;lt;/code&amp;gt;. It can be either anonymous or named.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
IClientItemExtensions extension = new IClientItemExtensions() {&lt;br /&gt;
// .....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An instance of it should be consumed in &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt; like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(extension);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or you can define and consume implementation at same time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
    // .....&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;Implementing first person Item Animation&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
In order to implmement first person Item Animation in &amp;lt;code&amp;gt;IClientItemExtensions&amp;lt;/code&amp;gt;, override &amp;lt;code&amp;gt;#applyForgeHandTransform&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
IClientItemExtensions extension = new IClientItemExtensions() {&lt;br /&gt;
    @Override&lt;br /&gt;
    public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
    // Returning true in this method is recommended as it will prevent this item stack from being handled by vanilla rendering system, preventing additional unwanted transformations from being applied.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;applyForgeHandTransform&amp;lt;/code&amp;gt; method's parameters are for:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;PoseStack poseStack&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: For stacking matrix poses. You can translate, rotate, scale item model with it.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;LocalPlayer player&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Main client player holding the item.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;HumanoidArm arm&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: For distinguishing which arm is holding the item. It's either &amp;lt;code&amp;gt;#LEFT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;#RIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemStack itemInHand&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt; that player is holding. Its &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is always the custom &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; that you're implementing animation for.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float partialTick&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0 for telling how much time has passed since last tick. If it's close to 0.0, it means current tick just started. If it's close to 1.0, it means current tick is almost over.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float equipProcess&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0. It's close to 0.0 when the sword gauge bar is full. It's close to 1.0 when sword gauge bar is low. [[File:That_short_gage_thing_under_cross.png]]&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float swingProcess&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0 for telling animation progress. If it's exactly at 0.0, the animation is not playing. If it's just close to 0.0, animation has just started playing. If it's close to 1.0, the animation is almost over.&lt;br /&gt;
&lt;br /&gt;
Here's example implementation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
        @Override&lt;br /&gt;
         public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
            int i = arm == HumanoidArm.RIGHT ? 1 : -1;&lt;br /&gt;
            poseStack.translate(i * 0.56F, -0.52F, -0.72F);&lt;br /&gt;
             if (player.getUseItem() == itemInHand &amp;amp;&amp;amp; player.isUsingItem()) {&lt;br /&gt;
                poseStack.translate(0.0, -0.05, 0.0);&lt;br /&gt;
            }&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;Implementing third person Item Animation&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
Implementing third person Item Animation is done via defining custom &amp;lt;code&amp;gt;HumanoidModel$ArmPose&amp;lt;/code&amp;gt; and returning it in &amp;lt;code&amp;gt;IClientItemExtensions#getArmPose&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Defining custom ArmPose ===&lt;br /&gt;
Forge makes &amp;lt;code&amp;gt;HumanoidModel$ArmPose&amp;lt;/code&amp;gt; enum extensible, allowing you to create custom entries using &amp;lt;code&amp;gt;HumanoidModel$ArmPose#create&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
private static final HumanoidModel.ArmPose EXAMPLE_POSE = HumanoidModel.ArmPose.create(&amp;quot;EXAMPLE&amp;quot;, false, (model, entity, arm) -&amp;gt; {&lt;br /&gt;
    if (arm == HumanoidArm.RIGHT) {&lt;br /&gt;
        model.rightArm.xRot = (float) (Math.random() * Math.PI * 2);&lt;br /&gt;
    } else {&lt;br /&gt;
        model.leftArm.xRot = (float) (Math.random() * Math.PI * 2);&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;create&amp;lt;/code&amp;gt; takes in 3 arguments:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;String name&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Name of the custom pose.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;boolean twoHanded&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Whether or not the animation should be two handed or single handed.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;IArmPoseTransformer forgeArmPose&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Functional interface for custom arm rendering logic.&lt;br /&gt;
&lt;br /&gt;
after that, override &amp;lt;code&amp;gt;IClientItemExtensions#getArmPose&amp;lt;/code&amp;gt; so that it returns newly created enum entry.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public HumanoidModel.ArmPose getArmPose(LivingEntity entityLiving, InteractionHand hand, ItemStack itemStack) {&lt;br /&gt;
    if (!itemStack.isEmpty()) {&lt;br /&gt;
        if (entityLiving.getUsedItemHand() == hand &amp;amp;&amp;amp; entityLiving.getUseItemRemainingTicks() &amp;gt; 0) {&lt;br /&gt;
            return EXAMPLE_POSE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return HumanoidModel.ArmPose.EMPTY;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
It has additional check to ensure only play custom arm rendering logic when player is actually using this item.&lt;br /&gt;
&lt;br /&gt;
== Tying it all up ==&lt;br /&gt;
Combining both examples into single &amp;lt;code&amp;gt;IClientItemExtensions&amp;lt;/code&amp;gt; would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer)&lt;br /&gt;
{&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
&lt;br /&gt;
        private static final HumanoidModel.ArmPose EXAMPLE_POSE = HumanoidModel.ArmPose.create(&amp;quot;EXAMPLE&amp;quot;, false, (model, entity, arm) -&amp;gt; {&lt;br /&gt;
            if (arm == HumanoidArm.RIGHT) {&lt;br /&gt;
                model.rightArm.xRot = (float) (Math.random() * Math.PI * 2);&lt;br /&gt;
            } else {&lt;br /&gt;
                model.leftArm.xRot = (float) (Math.random() * Math.PI * 2);&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        @Override&lt;br /&gt;
        public HumanoidModel.ArmPose getArmPose(LivingEntity entityLiving, InteractionHand hand, ItemStack itemStack) {&lt;br /&gt;
            if (!itemStack.isEmpty()) {&lt;br /&gt;
                if (entityLiving.getUsedItemHand() == hand &amp;amp;&amp;amp; entityLiving.getUseItemRemainingTicks() &amp;gt; 0) {&lt;br /&gt;
                    return EXAMPLE_POSE;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            return HumanoidModel.ArmPose.EMPTY;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        @Override&lt;br /&gt;
        public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
            int i = arm == HumanoidArm.RIGHT ? 1 : -1;&lt;br /&gt;
            poseStack.translate(i * 0.56F, -0.52F, -0.72F);&lt;br /&gt;
            if (player.getUseItem() == itemInHand &amp;amp;&amp;amp; player.isUsingItem()) {&lt;br /&gt;
                poseStack.translate(0.0, -0.05, 0.0);&lt;br /&gt;
            }&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Items]]&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Custom_Item_Animations&amp;diff=3316</id>
		<title>Custom Item Animations</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Item_Animations&amp;diff=3316"/>
		<updated>2022-09-03T11:43:06Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Under construction}}&lt;br /&gt;
Custom Item animation allows items to have both 3rd person and 1st person animation. This is done by consuming custom client extension with custom rendering logic in &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Defining custom client extension ==&lt;br /&gt;
First, create a implementation of &amp;lt;code&amp;gt;IClientItemExtensions&amp;lt;/code&amp;gt;. It can be either anonymous or named.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
IClientItemExtensions extension = new IClientItemExtensions() {&lt;br /&gt;
// .....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An instance of it should be consumed in &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt; like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(extension);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or you can define and consume implementation at same time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
    // .....&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;Implementing first person Item Animation&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
In order to implmement first person Item Animation in IClientItemExtensions, override &amp;lt;code&amp;gt;#applyForgeHandTransform&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
IClientItemExtensions extension = new IClientItemExtensions() {&lt;br /&gt;
    @Override&lt;br /&gt;
    public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
    // Returning true in this method will prevent this item stack from being handled by vanilla rendering system.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;applyForgeHandTransform&amp;lt;/code&amp;gt; method's parameters are for:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;PoseStack poseStack&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: For stacking matrix poses. You can translate, rotate, scale item with it.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;LocalPlayer player&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Main client player holding the item.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;HumanoidArm arm&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: For distinguishing which arm is holding the item. It's either &amp;lt;code&amp;gt;#LEFT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;#RIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemStack itemInHand&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt; that player is holding. Its &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is always the custom &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; that you're defining currently.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float partialTick&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0 for telling how much time has passed since last tick. If it's close to 0.0, it means current tick just started. If it's close to 1.0, it means current tick is almost over.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float equipProcess&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0. If it's close to 0.0, It's close to 0.0 when the sword gauge bar is full. It's close to 1.0, when sword gauge bar is low. [[File:That_short_gage_thing_under_cross.png]]&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float swingProcess&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0 for telling animation progress. If it's exactly at 0.0, the animation is not playing. If it's just close to 0.0, animation has just started playing. If it's close to 1.0, the animation is almost over.&lt;br /&gt;
&lt;br /&gt;
Here's example implementation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
        @Override&lt;br /&gt;
         public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
            int i = arm == HumanoidArm.RIGHT ? 1 : -1;&lt;br /&gt;
            poseStack.translate(i * 0.56F, -0.52F, -0.72F);&lt;br /&gt;
            applyItemArmTransform(poseStack, arm);&lt;br /&gt;
            if (player.getUseItem() != itemInHand) {&lt;br /&gt;
                return true;&lt;br /&gt;
            }&lt;br /&gt;
             if (player.isUsingItem()) {&lt;br /&gt;
                poseStack.translate(0.0, -0.05, 0.0);&lt;br /&gt;
            }&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Items]]&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Custom_Item_Animations&amp;diff=3315</id>
		<title>Custom Item Animations</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Item_Animations&amp;diff=3315"/>
		<updated>2022-09-03T11:38:25Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: Created page with &amp;quot;{{Under construction}} Custom Item animation allows items to have both 3rd person and 1st person animation. This is done by consuming custom client extension with custom rende...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Under construction}}&lt;br /&gt;
Custom Item animation allows items to have both 3rd person and 1st person animation. This is done by consuming custom client extension with custom rendering logic in &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Defining custom client extension ==&lt;br /&gt;
First, create a implementation of &amp;lt;code&amp;gt;IClientItemExtensions&amp;lt;/code&amp;gt;. It can be either anonymous or named.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
IClientItemExtensions extension = new IClientItemExtensions() {&lt;br /&gt;
// .....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An instance of it should be consumed in &amp;lt;code&amp;gt;Item#initializeClient&amp;lt;/code&amp;gt; like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(extension);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or you can define and consume implementation at same time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
    // .....&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;Implementing first person Item Animation&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
In order to implmement first person Item Animation in IClientItemExtensions, override &amp;lt;code&amp;gt;#applyForgeHandTransform&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
IClientItemExtensions extension = new IClientItemExtensions() {&lt;br /&gt;
    @Override&lt;br /&gt;
    public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
    // Returning true in this method will prevent this item stack from being handled by vanilla rendering system.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;applyForgeHandTransform&amp;lt;/code&amp;gt; method's parameters are for:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;PoseStack poseStack&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: For stacking matrix poses. You can translate, rotate, scale item with it.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;LocalPlayer player&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Main client player holding the item.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;HumanoidArm arm&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: For distinguishing which arm is holding the item. It's either &amp;lt;code&amp;gt;#LEFT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;#RIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ItemStack itemInHand&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt; that player is holding. Its &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is always the custom &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; that you're defining currently.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float partialTick&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0 for telling how much time has passed since last tick. If it's close to 0.0, it means current tick just started. If it's close to 1.0, it means current tick is almost over.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float equipProcess&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0. If it's close to 0.0, It's close to 0.0 when the sword gauge bar is full. It's close to 1.0, when sword gauge bar is low. [[File:That_short_gage_thing_under_cross.png]]&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;float swingProcess&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;: Value ranging from 0.0 to 1.0 for telling animation progress. If it's exactly at 0.0, the animation is not playing. If it's just close to 0.0, animation has just started playing. If it's close to 1.0, the animation is almost over.&lt;br /&gt;
&lt;br /&gt;
Here's example implementation:&lt;br /&gt;
@Override&lt;br /&gt;
public void initializeClient(Consumer&amp;lt;IClientItemExtensions&amp;gt; consumer) {&lt;br /&gt;
    consumer.accept(new IClientItemExtensions() {&lt;br /&gt;
        @Override&lt;br /&gt;
         public boolean applyForgeHandTransform(PoseStack poseStack, LocalPlayer player, HumanoidArm arm, ItemStack itemInHand, float partialTick, float equipProcess, float swingProcess) {&lt;br /&gt;
            int i = arm == HumanoidArm.RIGHT ? 1 : -1;&lt;br /&gt;
            poseStack.translate(i * 0.56F, -0.52F, -0.72F);&lt;br /&gt;
            applyItemArmTransform(poseStack, arm);&lt;br /&gt;
            if (player.getUseItem() != itemInHand) {&lt;br /&gt;
                return true;&lt;br /&gt;
            }&lt;br /&gt;
             if (player.isUsingItem()) {&lt;br /&gt;
                poseStack.translate(0.0, -0.05, 0.0);&lt;br /&gt;
            }&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[[Category:Items]]&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=File:That_short_gage_thing_under_cross.png&amp;diff=3314</id>
		<title>File:That short gage thing under cross.png</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=File:That_short_gage_thing_under_cross.png&amp;diff=3314"/>
		<updated>2022-09-03T09:19:24Z</updated>

		<summary type="html">&lt;p&gt;Tmvkrpxl0: I don't know how to name it. It's for Custom Item Animation Documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
I don't know how to name it. It's for Custom Item Animation Documentation&lt;br /&gt;
== Licencing ==&lt;br /&gt;
{{PD-ineligible}}&lt;/div&gt;</summary>
		<author><name>Tmvkrpxl0</name></author>
	</entry>
</feed>