rikka0w0 / MobZReborn

Continued of https://github.com/Globox1997/MobZ
https://www.curseforge.com/minecraft/mc-mods/mobz
7 stars 1 forks source link

How to add dependency #3

Open Ezoteric opened 3 years ago

Ezoteric commented 3 years ago

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

rikka0w0 commented 3 years ago

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 git@github.com: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
    }
  4. Reimport your root project (the one you are writing) into your IDE
  5. 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~