Zen Summoning

Zen Summoning

7M Downloads

Error at launch

LoloElSupremo opened this issue ยท 4 comments

commented

Here is my script :
https://pastebin.com/pZZP0eAS

I generated the data with the site https://minecraft.tools
And I can't see where the error is.
In the chat he shows me : zensummoning.zs:19 -- } or , expected

commented

I think the issue was the datatypes used in MC commands weren't allowed in the zenscript
e.g., 2F => 2, 0b => false

I also quoted the identifiers, and now it seems like it's working.

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

SummoningDirector.enableDebugging();
SummoningDirector.addSummonInfo(
    SummoningInfo.create()
        .setCatalyst(<minecraft:stick>)
        .setConsumeCatalyst(false)
        .setReagents([<minecraft:stone>, <minecraft:egg>*12])
        .addMob(MobInfo.create()
            .setMob("minecraft:zombie")
            .setCount(1)
            .setOffset(0,4,0)
            .setSpread(1,1,1)
            .setData(
                {
                    "PersistenceRequired":false,
                    "LeftHanded":0,
                    "CanPickUpLoot":false,
                    "Health":100,
                    "Attributes":[
                        {
                            "Name":"generic.maxHealth",
                            "Base":100
                           }
                    ],
                    "IsBaby":0,
                    "HandItems":[
                        {
                        "id":"minecraft:obsidian",
                        "Count":1
                        },
                        {}
                    ],
                    "HandDropChances":[2,0]
                }
            )
        )
        .setMutator(function (attempt as SummoningAttempt) {
            if (attempt.world.raining) {
                attempt.success = false;
                attempt.message = "Can't summon this in the rain!";
            } else {
                attempt.message = "Good Luck!";
            }
        })
);
commented

Thank you, I would like to offer a reward for killing the mob is it possible?

commented

He still doesn't drop obsidian

commented

Looks like the "HandDropChances":[2,0] should be 2,2 instead of 2,0