MobZ

MobZ

1M Downloads

How to add dependency

Ezoteric opened this issue ยท 1 comments

commented

Hey i want to add a mob from this mod to be a boss in a mod (world of exile).
I know shit for coding but i do know some things.

I want to add a mob from your mod in this line

    addBoss(list, EntityType.WITHER_SKELETON); <--

So what do i have to import in the file
And how do i add dependency in build file

Thnx

commented

I'm assuming that your mod will depend on this mod. (which means your mod will crash if this mod is not installed).
If you are using Git or Github to manage your codebase, you can do the following:

  1. Add this mod as a submodule in your project, make sure you have initialized your git repo (create a folder, enter it and then git init), then run this command in your repo root: git submodule add [email protected]:rikka0w0/MobZReborn.git
  2. Add this line to settings.gradle under your repo root: include 'MobZReborn'. Create the file if it does not exist.
  3. In your build.gradle, add a line to the dependencies section, like this:
dependencies {
    ..... Something already exists
    implementation project(':MobZReborn') <<----- Add this
}
  1. Reimport your root project (the one you are writing) into your IDE
  2. Now you should be able to access the classes within this mod. The entity types are declared in net.mobz.init.MobZEntities.java, you can pass them as the parameter when you try to spawn a mob.

Not sure if you are targeting Fabric or Forge, the above is for Forge and should also apply to Fabric. In addition, I would suggest you declare this mod as a dependency in mods.toml (Forge) or fabric.mod.json (Fabric), and make sure that your mod loads after this mod, otherwise weird things can happen.

Once you finish your mod, please let me know, I would like to add it to my server!

Regards~