Help on adding external library

Started by CapCreeperGR on

Topic category: Advanced modding

Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help on adding external library

Hello! I am trying to add the galacticraft api to mcreator and use it to create custom planets and solar systems with custom elements but I am not sure how to do that. I added it in the external APIs tab in workspace settings and it could detect if I had the mod installed or not but the problem is I can not use its code on custom elements. I am pretty sure I need to import its .jar file somehow but I can't find how? Can anyone help me?

Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nevermind I found out how to…
Sun, 01/24/2021 - 11:18

Nevermind I found out how to do it. I just added this code

flatDir {
    dirs 'libs'
}

to the repositories in the build.gradle file. Now any library that's in the libs folder will automatically get added

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey ! Where is the libs…
Sun, 02/28/2021 - 16:38

Hey !
Where is the libs folder ?
I have add the

flatDir {
    dirs 'libs'
}

to my build.gradle repositories

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        jcenter()
        mavenCentral()
		flatDir {
			dirs 'libs'
		}
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
    }
}

but i didn't find the libs folder what you say.

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello, I have the same issue…
Sat, 08/17/2024 - 13:45

Hello, I have the same issue that CapCreeperGR had. But I can't find 'libs' folder and I don't know how to use Gradle... Help me please((

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
OK, I found 'libs' folder…
Sun, 08/18/2024 - 11:06

OK, I found 'libs' folder. But I can't find the context

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        jcenter()
        mavenCentral()

        in build.gradle. All I see is

plugins {
   id 'eclipse'
   id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
}
version = '1.0'
group = 'com.yourname.modid'
archivesBaseName = 'modid'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
   mappings channel: 'official', version: '1.20.1'
   accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
   copyIdeResources = true
   runs {
       client {
           workingDirectory project.file('run')
           property 'forge.logging.markers', 'REGISTRIES'
           property 'forge.logging.console.level', 'debug'
           mods {
               examplemod {
                   source sourceSets.main
               }
           }
       }
       server {
           workingDirectory project.file('run')
           property 'forge.logging.markers', 'REGISTRIES'
           property 'forge.logging.console.level', 'debug'
           mods {
               examplemod {
                   source sourceSets.main
               }
           }
       }
   }
}
dependencies {
   minecraft 'net.minecraftforge:forge:1.20.1-47.3.0'
}
tasks.withType(JavaCompile).configureEach {
   options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
apply from: 'mcreator.gradle'

IDK what I need to change because I'm afraid of file crash (I haven't got any skill in Java programming, and it's morbid). But I also can't install the lib through the Gradle, and it's more morbid. I will be happy if you'll give me an advice as soon as you can. (If you can reply immediately do it please)