<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alvalens</title>
    <description>The latest articles on DEV Community by Alvalens (@alvalens).</description>
    <link>https://dev.to/alvalens</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3223980%2F46e8e000-bd8c-4c62-80dd-a3c61c1daee6.jpg</url>
      <title>DEV Community: Alvalens</title>
      <link>https://dev.to/alvalens</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alvalens"/>
    <language>en</language>
    <item>
      <title>I Fixed a Minecraft Mod by Patching a Java .class File</title>
      <dc:creator>Alvalens</dc:creator>
      <pubDate>Sat, 19 Sep 2026 06:48:24 +0000</pubDate>
      <link>https://dev.to/alvalens/i-fixed-a-minecraft-mod-by-patching-a-java-class-file-1n63</link>
      <guid>https://dev.to/alvalens/i-fixed-a-minecraft-mod-by-patching-a-java-class-file-1n63</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8bg5ewmv2oz7cp7yiijh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8bg5ewmv2oz7cp7yiijh.png" alt="Minecraft Dawncraft" width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was playing DawnCraft when I ran into a strangely specific bug.&lt;/p&gt;

&lt;p&gt;The Spellbound Book worked perfectly in singleplayer.&lt;/p&gt;

&lt;p&gt;On my dedicated server, it didn't.&lt;/p&gt;

&lt;p&gt;The weird part was that the book still applied its &lt;strong&gt;Misconduction&lt;/strong&gt; effect. It was only the actual attacks that stopped working.&lt;/p&gt;

&lt;p&gt;That was annoying enough that I stopped trying to fix it from inside the game and opened the mod's JAR instead.&lt;/p&gt;

&lt;p&gt;The investigation eventually ended with me editing a compiled Java class file directly.&lt;/p&gt;

&lt;p&gt;The complete patch and reproduction tooling are available here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Alvalens/dawncraft-spellbound-server-fix" rel="noopener noreferrer"&gt;https://github.com/Alvalens/dawncraft-spellbound-server-fix&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The number that gave it away
&lt;/h2&gt;

&lt;p&gt;My setup was:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DawnCraft&lt;/td&gt;
&lt;td&gt;2.0.16_hf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Minecraft&lt;/td&gt;
&lt;td&gt;1.18.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Forge&lt;/td&gt;
&lt;td&gt;1.18.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Illage &amp;amp; Spillage&lt;/td&gt;
&lt;td&gt;1.18.2-1.1.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Server&lt;/td&gt;
&lt;td&gt;Exaroton dedicated server&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Spellbound Book is supposed to give the player &lt;code&gt;Misconduction&lt;/code&gt;, which enables its attacks.&lt;/p&gt;

&lt;p&gt;In this particular DawnCraft-bundled version, I found two relevant attacks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Empty main hand + right-click the top of a block → a line of Imps.&lt;/li&gt;
&lt;li&gt;Empty main hand + attack a mob while affected by Misconduction → three Illager Souls.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Singleplayer:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Both worked.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dedicated server:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Neither worked.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I even granted myself &lt;code&gt;Misconduction&lt;/code&gt; directly on the server to rule out the book itself.&lt;/p&gt;

&lt;p&gt;Still nothing.&lt;/p&gt;

&lt;p&gt;That gave me a useful split:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Spellbound Book
      │
      ├── Apply Misconduction ─────── WORKS
      │
      └── React to player actions ─── BROKEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the effect system wasn't the problem.&lt;/p&gt;

&lt;p&gt;Something was preventing the attack handlers from running.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F01oifvzqb3819w3wlc2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F01oifvzqb3819w3wlc2m.png" alt="Minecraft Inventory" width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The Spellbound Book in DawnCraft. The item and Misconduction effect worked; only the actual attacks failed on the dedicated server.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Going to the JAR instead of guessing
&lt;/h2&gt;

&lt;p&gt;The relevant mod was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;illageandspillage-1.18.2-1.1.3.jar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A JAR is just a ZIP archive containing compiled Java classes and metadata.&lt;/p&gt;

&lt;p&gt;So instead of changing random server settings, I started looking for the code responsible for the Spellbound attacks.&lt;/p&gt;

&lt;p&gt;One class immediately stood out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;com.yellowbrossproductions
    .illageandspillage
    .events
    .ModClientEvents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The name was interesting.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ModClientEvents&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I inspected the compiled class with &lt;code&gt;javap&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That's where the two attacks appeared.&lt;/p&gt;

&lt;p&gt;The first handler listens for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;PlayerInteractEvent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RightClickBlock&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and eventually calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;EntityUtil&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;createLineImpsAttack&lt;/span&gt;&lt;span class="o"&gt;(...)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second listens for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;LivingAttackEvent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and creates three &lt;code&gt;IllagerSoulEntity&lt;/code&gt; instances.&lt;/p&gt;

&lt;p&gt;So the implementation matched what I had observed in-game.&lt;/p&gt;

&lt;p&gt;The question changed from:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why doesn't Spellbound work?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Why aren't these event handlers receiving events on the dedicated server?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The smoking gun
&lt;/h2&gt;

&lt;p&gt;I inspected the class-level annotation.&lt;/p&gt;

&lt;p&gt;The original class contained:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Mod&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;EventBusSubscriber&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;modid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"illageandspillage"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;bus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Bus&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;FORGE&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Dist&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;CLIENT&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That was it.&lt;/p&gt;

&lt;p&gt;The event subscriber was explicitly restricted to the physical client.&lt;/p&gt;

&lt;p&gt;On an integrated singleplayer world, Minecraft is still running a client process alongside its integrated server.&lt;/p&gt;

&lt;p&gt;So the class gets registered.&lt;/p&gt;

&lt;p&gt;On a dedicated server, there is no physical client.&lt;/p&gt;

&lt;p&gt;So the class isn't registered.&lt;/p&gt;

&lt;p&gt;The behavior suddenly made sense:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 Spellbound attack
                        │
                        ▼
                 Forge event bus
                        │
              ┌─────────┴─────────┐
              │                   │
        Singleplayer        Dedicated Server
              │                   │
        Physical CLIENT    Physical SERVER
              │                   │
              ▼                   X
     ModClientEvents       Not registered
              │
              ▼
       Attack handlers
              │
       ┌──────┴──────┐
       ▼             ▼
     Imps       Illager Souls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server wasn't executing the wrong code.&lt;/p&gt;

&lt;p&gt;It wasn't executing the code at all.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why didn't I just recompile it?
&lt;/h2&gt;

&lt;p&gt;Once I knew the problem, the obvious source-level fix was tiny.&lt;/p&gt;

&lt;p&gt;Change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Mod&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;EventBusSubscriber&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;modid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"illageandspillage"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;bus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Bus&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;FORGE&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Dist&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;CLIENT&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Mod&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;EventBusSubscriber&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;modid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"illageandspillage"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;bus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Bus&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;FORGE&lt;/span&gt;
&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Forge can then use the annotation's default side behavior rather than restricting registration to &lt;code&gt;CLIENT&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But I didn't have the original source project and didn't want to rebuild an entire third-party mod just to change one annotation.&lt;/p&gt;

&lt;p&gt;So I patched the compiled class instead.&lt;/p&gt;




&lt;h2&gt;
  
  
  Editing the class file
&lt;/h2&gt;

&lt;p&gt;Java class files contain a constant pool, methods, fields, and attributes.&lt;/p&gt;

&lt;p&gt;Annotations such as this one are stored in the class's runtime-visible annotation metadata.&lt;/p&gt;

&lt;p&gt;The original annotation contained three element-value pairs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modid
bus
value = CLIENT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The patch removes only the &lt;code&gt;value&lt;/code&gt; element.&lt;/p&gt;

&lt;p&gt;So conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt; @Mod.EventBusSubscriber(
     modid = "illageandspillage",
&lt;span class="gd"&gt;-    bus = Bus.FORGE,
-    value = {Dist.CLIENT}
&lt;/span&gt;&lt;span class="gi"&gt;+    bus = Bus.FORGE
&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No spell code was changed.&lt;/p&gt;

&lt;p&gt;No entity behavior was changed.&lt;/p&gt;

&lt;p&gt;No damage values were changed.&lt;/p&gt;

&lt;p&gt;No configuration was changed.&lt;/p&gt;

&lt;p&gt;No new abilities were added.&lt;/p&gt;

&lt;p&gt;I changed the metadata that determines &lt;strong&gt;where the existing event subscriber gets registered&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I then repacked the modified class into the original JAR and verified the resulting class with &lt;code&gt;javap&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The repository contains the reproducible patching tool rather than redistributing the third-party mod itself:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Alvalens/dawncraft-spellbound-server-fix" rel="noopener noreferrer"&gt;https://github.com/Alvalens/dawncraft-spellbound-server-fix&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What I got wrong the first time
&lt;/h2&gt;

&lt;p&gt;My first instinct was to treat this like a normal modpack configuration problem.&lt;/p&gt;

&lt;p&gt;Maybe Exaroton was doing something weird.&lt;/p&gt;

&lt;p&gt;Maybe there was a server configuration I had missed.&lt;/p&gt;

&lt;p&gt;Maybe the mod simply didn't support multiplayer.&lt;/p&gt;

&lt;p&gt;Those weren't unreasonable guesses.&lt;/p&gt;

&lt;p&gt;But the useful clue was sitting in the behavior:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Singleplayer       → works
Dedicated server   → doesn't
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Forge mods, that should make physical-side separation one of the first things worth checking.&lt;/p&gt;

&lt;p&gt;The distinction is particularly easy to miss because integrated singleplayer isn't the same execution environment as a dedicated server.&lt;/p&gt;

&lt;p&gt;Something incorrectly marked as client-only can look completely healthy during local testing.&lt;/p&gt;




&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;I installed the patched JAR through Exaroton's override mechanism:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;overrides/
└── mods/
    └── illageandspillage-1.18.2-1.1.3.jar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I restarted the server.&lt;/p&gt;

&lt;p&gt;Empty hand.&lt;/p&gt;

&lt;p&gt;Misconduction active.&lt;/p&gt;

&lt;p&gt;Right-click the ground.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Imps.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then I attacked a mob.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three Illager Souls.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The same two attacks that worked in singleplayer now worked on the dedicated server.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3sey1t6tjsafdz691yv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm3sey1t6tjsafdz691yv.png" alt="spellbound effect working" width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;After the patch: the existing Spellbound attack works on the dedicated server.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  One important scope note
&lt;/h2&gt;

&lt;p&gt;There are newer Illage &amp;amp; Spillage versions and documentation that may describe additional Spellbound behavior.&lt;/p&gt;

&lt;p&gt;That's not what this patch is doing.&lt;/p&gt;

&lt;p&gt;I verified the actual code in the &lt;strong&gt;1.18.2-1.1.3 JAR bundled with DawnCraft 2.0.16_hf&lt;/strong&gt;, and the two relevant attacks are the ones described above.&lt;/p&gt;

&lt;p&gt;The patch doesn't add anything.&lt;/p&gt;

&lt;p&gt;It simply makes the existing event handlers register on the dedicated server.&lt;/p&gt;

&lt;p&gt;The repository is therefore intentionally version-specific rather than pretending to be a universal Illage &amp;amp; Spillage fix.&lt;/p&gt;




&lt;h2&gt;
  
  
  The part I didn't expect
&lt;/h2&gt;

&lt;p&gt;I started with a broken Minecraft spell.&lt;/p&gt;

&lt;p&gt;The eventual debugging path was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Observed behavior
      ↓
Singleplayer vs dedicated server comparison
      ↓
Inspect the mod JAR
      ↓
Find the event handlers
      ↓
Inspect event registration
      ↓
Find Dist.CLIENT
      ↓
Understand Forge physical sides
      ↓
Inspect classfile annotation
      ↓
Patch only the metadata
      ↓
Test on the real server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The actual fix was one annotation value.&lt;/p&gt;

&lt;p&gt;Everything else was figuring out &lt;strong&gt;which annotation mattered&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's probably the part I find most useful about the whole experiment.&lt;/p&gt;

&lt;p&gt;When a program behaves differently between environments, it's tempting to keep changing the environment until something works.&lt;/p&gt;

&lt;p&gt;Sometimes it's better to stop guessing and go one layer deeper.&lt;/p&gt;

&lt;p&gt;Even if that layer happens to be a Minecraft JAR.&lt;/p&gt;

</description>
      <category>java</category>
      <category>debugging</category>
      <category>minecraft</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
