Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[SOLVED] Error when trying to add dependency

Featured Replies

Posted

I am attempting to make a mod that serves as an expansion to the mod Basic Weapons by Khazoda for a (currently) personal modpack. I want to add a custom tier of the weapons that the mod adds, so I thought the simplest solution would be to make a mod that depends on BW to work (I tried KubeJS and that was a no go given other mods that interact with the weapons). Depending on BW would also let me use the methods so I don't have to recreate the behavior of certain weapons. To start, I followed KaupenJoe's 1.20.1 modding setup tutorial and the simple item tutorial. Then I followed the Modrinth Maven tutorial to add BW as a dependency to my mod. I swear on my soul that after doing this, ONCE I was able to do the gradle runClient, and the game loaded up with no errors. However, now every time I try to do this again, I get this error showing in the game client:

Basic Weapons (basicweapons) has failed to load correctly

org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered

Here is the latest crash .txt and the latest.log:

pastebin.com/MpdMwwj6

pastebin.com/RMXM3g5p

I think it has to do with their use of the spongepowered mixin thing in their build.gradle, but it may also be related to the fact I am using parchment mapping (just what the tutorial said to do, feel free to say if using that is bad practice) and BW is using official mappings. Here is also my git page for my mod in its current state, along with the page for Khazodas mod (the branch that I am currently dealing with via Modrinth maven):

github.com/McNasty102/Forge-Mod-Test/tree/mod-test

github.com/Khazoda/basic-weapons/tree/1.20.1-forge

Edited by McNasty
resolved issue

Your repository appears to be private.

You probably need to add the MixinGradle plugin to allow it to deobfuscate the mixins from your dependency. You shouldn't need the annotation processor or other configuration from that page unless you're using mixins yourself.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Ah, sorry about that, should be public now.

I'll look into that plugin, thank you for your response.

EDIT:

Upon adding the plugin to the build.gradle, the runClient crashed, here are the crash txt and the latest.log:
pastebin.com/6m0TcNqe

pastebin.com/U978GhBq

Edited by McNasty
Additional information

Caused by: java.lang.NoSuchMethodError: 'float net.minecraft.world.item.Tier.m_6631_()'

at com.seacroak.basicweapons.item.BasicWeaponItem.<init>(BasicWeaponItem.java:34) ~[basicweapons-1.2.4+1.20.1.jar%23191!/:1.2.4+1.20.1] {re:classloading}

m_6631_ is Tier.getAttackDamageBonus, you can see the call in the Basic Weapons code here. I'm not sure why this is happening, the fg.deobf call in build.gradle should be deobfuscating the dependency from SRG to Official/Parchment names. Did you definitely have fg.deobf in place when you got this crash? Try refreshing the Gradle project in your IDE to make sure it's in sync with the build script. In IntelliJ IDEA, this can be done with the "Sync All Gradle Projects" button in the Gradle window.

If this doesn't help, you may want to ask in the #mod-dev-support-1․20․x channel on Discord as there are people there that don't read the forums.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

fg.deobf was definitely in place. Everything you see on my github page is how it was when I first made the post. I only added the plugin to the build.gradle then tried running the code on my machine (without pushing the code) leading to the runClient crash. I've tried several Gradle refreshes/syncs, only to get the same error (I found the same reference to m_6631_) though I may be doing it wrong as I'm not that experienced with using Gradle. I am on VSCode. I'll follow your suggestion and try the discord.

  • Author

Okay after changing to Eclipse and talking with the people in the server, I have solved the issue. Not only was I referencing the mod in my dependencies (build.gradle and mods.toml) but I also had the .jar in my /run/mods directory. It was the second causing the issue. We figured this out as I was able to build my mod and run it together with BW in a regular forge 1.20.1 instance. I believe it was also necessary to add the previously mentioned MixinGradle Plugin to the build.gradle file. Thanks to everyone for your help!

  • McNasty changed the title to [SOLVED] Error when trying to add dependency

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.