Topic category: Troubleshooting, bugs, and solutions
I spontaneously started getting build errors with a sword in my mod. I couldn't fix it, so I loaded an autosave backup from the previous day. When I ran the client for a test the sword seemed to be entirely missing from the game, even though the element was visible in MCreator. I wanted to edit the code of the sword to see if anything looked weird, but found that the edit button wasn't doing anything. I went to modid/src/main/java/net/modid/item and looked for the sword there to manually open the .java file in a text editor when I found that it was completely missing! I ended up using a hacktool to decompile the current version of my mod and from the source of it retrieved another sword .java file. I copied this file to my mod's .../modid/item directory and regenerated the code (I read the pinned thread here). When I regenerated the code, it literally deleted my sword's .java file. I don't know why it's doing this, and I don't know why it is happening seemingly on a whim. Keep in mind that the backup I loaded was from the previous day, so none of my recent edits could have affected this, I don't believe.
If anyone could help me fix this, I would really appreciate it! :)
I may have found the issue. Yesterday or the day before I had added a right-clicked-in-air trigger to the sword to play around. Once I was finished, I deleted it. It seems that deleting it had some adverse effect on the sword that wasn't apparent until now. I went into the sword's trigger page and, while it showed that no procedures were selected for any of the triggers, I made sure by manually selecting the "(no procedure)" option.