Zen Summoning

Zen Summoning

7M Downloads

[Request] Gamestages integration

ChiefLogan3010 opened this issue ยท 2 comments

commented

Enjoying the options this mod gives me, but it would be pretty nice to be able to also set a gamestage requirement for summoning, if possible.

commented

+1 on this feature, would be really useful

commented

Should be feasible in the latest version using new addCondition feature

import crafttweaker.api.item.IItemStack;
import crafttweaker.api.item.IIngredient;
import mods.zensummoning.SummoningDirector;
import mods.zensummoning.SummoningAttempt;
import mods.zensummoning.SummoningInfo;
import mods.zensummoning.MobInfo;
import crafttweaker.api.player.MCPlayerEntity;


SummoningDirector.addSummonInfo(
    SummoningInfo.create()
        .setCatalyst(<item:minecraft:stick>)
        .setConsumeCatalyst(false)
        .setReagents([<item:minecraft:diamond>, <item:minecraft:redstone>*12])
        .addMob(MobInfo.create().setMob(<entityType:minecraft:cow>))
        .addCondition((attempt as SummoningAttempt) => {
            if (attempt.summoner == null)
                return false;
            if ((attempt.summoner as MCPlayerEntity).foodLevel > 15)
                return false;
            return true;
        }, "You aren't hungry enough", "Must be under 15 hunger!")
        .setMutator((attempt as SummoningAttempt) => {
            (attempt.summoner as MCPlayerEntity).foodLevel = 2;
        })

);

the attempt.summoner object should have methods for gamestages added by the gamestages mod