TeamDman / Zen-Summoning

A mod that allows for pack creators to set up custom summoning situations using ZenScript
2 stars 1 forks source link

1.16.5 could not use example script #23

Closed 6371peter closed 3 years ago

6371peter commented 3 years ago

ZenSummoning-1.16.4-1.3.0,CraftTweaker-1.16.5-7.1.0.314 When copy https://github.com/TeamDman/Zen-Summoning/wiki/Docs Full example script into scripts,it will be error. craftweaker.txt

TeamDman commented 3 years ago

Looks like I forgot to update the old example stuff The latest docs are available on the crafttweaker documentation here https://docs.blamejared.com/1.16/en/mods/zensummoning/examples/

The latest CT version needs qualifiers on the bracket handlers For example <minecraft:stick> becomes <item:minecraft:stick> Additionally, the setMob command now takes an EntityType param instead of String so instead of setMob("minecraft:cow") it becomes setMob(<entityType:minecraft:cow>)

Will try and update the official docs soon, but for now the old example should look like this for 1.16

import mods.zensummoning.SummoningDirector;
import mods.zensummoning.SummoningAttempt;
import mods.zensummoning.SummoningInfo;
import mods.zensummoning.MobInfo;

SummoningDirector.addSummonInfo(
    SummoningInfo.create()
        .setCatalyst(<item:minecraft:stick>)
        .setReagents([<item:minecraft:stone>, <item:minecraft:egg>*12])
        .addMob(MobInfo.create()
            .setMob(<entityType:minecraft:cow>)
            .setCount(4)
            .setOffset(0,4,0)
            .setSpread(3,3,3)
            .setData({"Health": 200, "Attributes":[{"Name":"generic.maxHealth","Base":200}]})
        )
        .setMutator((attempt as SummoningAttempt) => {
            if (attempt.world.raining) {
                attempt.success = false;
                attempt.message = "Can't summon this in the rain!";
            } else {
                attempt.message = "Woohoo!";
            }
        })
);
TeamDman commented 3 years ago

https://github.com/CraftTweaker/CraftTweaker-Documentation/pull/439#event-4941869153 Updated the docs

Goldenlion5648 commented 3 years ago

The word "type" in should be lower case

Goldenlion5648 commented 3 years ago

@TeamDman ^

TeamDman commented 3 years ago

works with upper for me .-.

Goldenlion5648 commented 3 years ago

works for me too, just doesn't match the way crafttweaker outputs it in logs