MineTweaker3 icon indicating copy to clipboard operation
MineTweaker3 copied to clipboard

Feature Request: The ability to check if a mod has loaded

Open FayeAlephNil opened this issue 10 years ago • 8 comments

I don't know if this is already in, but if it is not it would be great to use in a library file (#55) such as in the PhoenixConfigs

FayeAlephNil avatar Sep 01 '14 16:09 FayeAlephNil

That is already requested feature by me on Forum ;) It is planned.

Steamoonkie avatar Sep 01 '14 17:09 Steamoonkie

@CastielAngelow thanks, close?

FayeAlephNil avatar Sep 01 '14 17:09 FayeAlephNil

It's planned. Actually you can use the following expression:

if "IC2" in loadedMods {
    print("Doing stuff");
}

However, evaluation of bracket expressions would still fail if the items can't be found and variables declared inside if blocks are not available outside them, making this construct not very useful at this point. I will soon enable lazy evaluation of bracket values so this becomes possible.

stanhebben avatar Sep 01 '14 17:09 stanhebben

Sorry if I bother anyone, but I wonder if there is any progress? Cause I try to use the following scripts but doesn't work:

if (loadedMods.contains("Railcraft")) {
    print("[Info] Welcome to use Railcraft");
}

If I make any mistakes please point out.

3TUSK avatar Jan 31 '16 19:01 3TUSK

The example was if "IC2" in loadedMods, your syntax is completely different. Maybe that's the problem?

PrincessRTFM avatar Jan 31 '16 22:01 PrincessRTFM

@PrincessRTFM I know that's completely different, but I noticed something different from the actual codes: https://github.com/stanhebben/MineTweaker3/blob/master/MineTweaker3-MC1710-Main/src/main/java/minetweaker/mc1710/mods/MCLoadedMods.java#L20 https://github.com/stanhebben/MineTweaker3/blob/master/MineTweaker3-MC1710-Main/src/main/java/minetweaker/mc1710/MineTweakerMod.java#L96

3TUSK avatar Jan 31 '16 22:01 3TUSK

Uh @3tusk, congrats! You are the first person that I have seen that has tried to use java in zenscript :P

What you are trying is how a mod would check if another mod is present, try the method that Stan showed.

jaredlll08 avatar Feb 01 '16 05:02 jaredlll08

Technically the second @jaredlll08 lol I tried it in the Fluid Dict handling Blank Spaces for Life Essence lol

  • Edit: added link.

Blue64 avatar Feb 01 '16 21:02 Blue64