Have items only be available when other mod is installed?

Started by Nelson TheAwesome on

Topic category: Help with modding (Java Edition)

Last seen on 14:34, 28. Jan 2024
Joined Feb 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Have items only be available when other mod is installed?

Hi, I was wondering if I could make tools/items in my mod that would only work if another mod is installed, for example a mod that adds emerald tools or such and my mod that adds tool variant with different variants of every tool with different handles based on the type of wood used to craft the sticks. I'd like to make it so I could make emerald tools that have all the different variants, but they only show up in game if you have that other mod installed. If you didn't have it installed you wouldn't be able to craft them (even though the crafting recipe uses vanilla emeralds) and you wouldn't be able to see them in the creative inventory.

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Your mod shouldn't even load…
Tue, 06/02/2020 - 14:02

Your mod shouldn't even load in if you have made it dependent on another mod. I am not sure if you are able to do this in MCreator though.

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh my that was the 3000 post…
Tue, 06/02/2020 - 14:09

Oh my that was the 3000 post on this forum...

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
as I always tell people on…
Tue, 06/02/2020 - 14:28

as I always tell people on these forums, a lot of things are not possible without programming.

Here goes the nerdy explanation:

You would either need the deobf version or if the mod files are hosted on maven stuff, the maven data for the build.gradle. Usually on their mods' Github readme page.

if you have the deobf version just drop it to your mod workspace's root folder (not the src folder) and add this line to the bottom "dependencies" part of build.gradle (NOT the one in buildscript!): 

compile files("Kiwi-1.15.2-2.7.0-deobf.jar")

replace "Kiwi-1.15.2-2.7.0-deobf.jar" with the full file name of the deobf version of the mod file, including the file extension

so your build.gradle would look something like this:

minecraft{
    [...]
	mappings channel: 'snapshot', version: '20200304-1.15.1'
	runs {
    [...]
	}
}

repositories {
    [...]
}

dependencies {
	minecraft 'net.minecraftforge:forge:1.15.2-31.1.9'
//remember to include the quotation marks
	compile files("my_cool_mod-1.15.2-1.0.0.jar")
}

again, don't attempt this unless you have at least of a basic understanding of Java.

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@CrispyChip I thought you…
Tue, 06/02/2020 - 14:32

@CrispyChip I thought you said to tell them it is not possible with MCreator?

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ahem. it is not possible…
Wed, 06/03/2020 - 01:55

ahem.

it is not possible with MCreator without java.

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not giving code. I said…
Wed, 06/03/2020 - 02:21

I'm not giving code.

I said don't do this unless you understand java and I explained what the code does and how to do it.

please don't argue with people everywhere you go.

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
fine this is not respectful…
Wed, 06/03/2020 - 02:23

fine this is not respectful of me, guess I'll just have to ignore you

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I explained what the method…
Wed, 06/03/2020 - 02:25

I explained what the method did.

please don't argue with people everywhere you go.

I don't argue with people, I have formed a lot of positive relations on this forum. I argue with you, only because you got all pissy pants about 3 lines of code, and you would of rather me just done nothing lol.

Code provided was not usable…
Wed, 06/03/2020 - 10:15

Code provided was not usable snippet so it was not really code spooning, at least I think so ;)

as I always tell people on these forums, a lot of things are not possible without programming.

It is normal that if one wants to use APIs, code will be needed. There is no way on earth I could integrate support for all APIs in MCreator XD

Lastly, keep this friendly guys, no need to argue ;)

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yah thanks for coming here…
Wed, 06/03/2020 - 10:48

yah thanks for coming here to keep the peace, the discussion is getting a bit heated lol :D

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Code provided was not usable…
Wed, 06/03/2020 - 15:09

Code provided was not usable snippet so it was not really code spooning,

It was more about showing the absurdity in another post. But yes, I am sorry CrispChip for not keeping the peace.

Last seen on 14:34, 28. Jan 2024
Joined Feb 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I decided just to create a…
Wed, 06/03/2020 - 15:35

I decided just to create a separate mod file that is just an addon for my mod that makes it compatible with the other mod xD though seems putting the other mod’s mod id in the required mods list doesn’t actually stop you from using it. I expected it to not let you play with the addon mod unless you have the mod it’s supposed to be working with.

 

also side note I figured out if I make an item in mcreator, lock it, then replace the item name in @ObjectHolder(“item name”) with the item from the other mod I basically make like a reference item that I can use in crafting recipe’s and stuff and in game it’ll use the item from the other mod which is pretty nice

Last seen on 09:13, 27. Mar 2024
Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also side note I figured out…
Wed, 01/03/2024 - 09:54

also side note I figured out if I make an item in mcreator, lock it, then replace the item name in @ObjectHolder(“item name”) with the item from the other mod I basically make like a reference item that I can use in crafting recipe’s and stuff and in game it’ll use the item from the other mod which is pretty nice

How did you do this i cant find where the object handler is for the item