CraftBook 3

CraftBook 3

139k Downloads

crafting-recipes config

LadyCailinBot opened this issue ยท 18 comments

commented

CRAFTBOOK-2862 - Reported by Revdutchie

Hello,

I used the default craftbook example for recipes and they worked fine, now I added a new recipe and removed the #info lines and now nothing works. Can you give me a hint what I did wrong? Here is my code

crafting-recipes: shapelessexample: type: shapeless ingredients: 'wood:2': 1 'wood:2': 1 '35:12': 1 '35:12': 1 results: '121': 4 craftedhorsearmor: type: shapeless '57': 1 '57': 1 '57': 1 results: '419': 1 shapeexample: type: shaped 'wood:2': 'a' '35:12': 'b' shape: - 'aa' - 'bb' results: '121': 4
commented

Comment by me4502

It's most likely because you have defined 'wood:2': 1 twice in each one, YAML doesn't support that.
If you want to use multiple of something, use 'wood:2': 2

commented

Comment by me4502

It appears that that recipe is valid, yes.

commented

Comment by Revdutchie

I am testing, but I think I know why sometimes it is not working, ill let you know asap.

commented

Comment by Revdutchie

Ok, what I found out is that name and lore is actualy working fine.
But I use a pickaxe WITH enchants and as soon it has an enchant it aint working anymore.
Now maybe if I add the enchant to the recipe it will work, but then I have to make recipies with all possible enchants. Is there maybe a way to make so crafting-recipes just ignore enchants ?

commented

Comment by me4502

In the bit where you add enchants, add $IGNORE

commented

Comment by Revdutchie

Tried that like this

StoneCrusher:
type: shapeless
ingredients: #mc only supports amount of 1 currently as ingredients.
'278;$IGNORE|Stone Crusher|No block will stop you now.': 1
results:
'293;DIG_SPEED:2|Expensive Hoe|Not for the poor|It be expensive': 1

A non enchanted pickaxe works as ingrediant, an enchanted doesnt.

Also two of the same items but with different names wont work, I tried this

DuoCrushers:
type: shapeless
ingredients: #mc only supports amount of 1 currently as ingredients.
'278|Stone Crusher|No block will stop you now.': 1
'278|Stone Crusher V2|No block will stop you now.': 1
results:
'293;DIG_SPEED:3|Expensive Hoe|Not for the poor|It be expensive': 1

commented

Comment by me4502

It seems $IGNORE for enchants was never implemented, I'll add that to my todo list.

I'll look into the rest hopefully soon, but a recode of custom crafting is planned. It'll probably be recoded instead of the issues fixed.

commented

Comment by Revdutchie

No problem, I'll make a workaround then, thanks for your attention.

commented

Comment by Revdutchie

The wood part came from the craftbook example file, I did not touch that and it worked, but ok let me remove all the examples. Ill update you in 10 minutes.

commented

Comment by Revdutchie

Ok changed to this;

crafting-recipes:
shapeexample:
type: shaped
'57:3': 'a'
shape:
- 'aaa'
results:
'419': 1

Its nor working and on server restart I get;
26.01 19:42:17 [Server] INFO ^
26.01 19:42:17 [Server] INFO '57:3': 'a'
26.01 19:42:17 [Server] INFO org.yaml.snakeyaml.scanner.ScannerException: null; mapping values are not allowed here; in 'reader', line 4, column 13:
26.01 19:42:17 [Server] WARN Failed to initialize mechanic: CustomCrafting

Now I loaded the example config again;
crafting-recipes:
shapelessexample:
type: shapeless
ingredients: #mc only supports amount of 1 currently as ingredients.
# light wooden plank
'wood:2': 1
# light wooden plank
'wood:2': 1
# brown wool
'35:12': 1
# brown wool
'35:12': 1
results:
#64 Endstone.
'121': 64
shapeexample:
type: shaped
ingredients: #mc only supports amount of 1 currently as ingredients.
# light wooden plank
'wood:2': 'a'
# brown wool
'35:12': 'b'
shape: #two of a on top, 2 of b on bottom.
- 'aa'
- 'bb'
results:
#64 Endstone.
'121': 64
furnaceexample:
type: furnace
ingredients:
# light wooden plank
'wood:2': 1
results:
#1 Stone.
'1': 1

and that works. Am I getting insane here ? I see no diference

commented

Comment by Revdutchie

Ok did some more tests, looks like the problem is in the shapeless part.
Now I have used this it works

crafting-recipes:
shapeexample:
type: shaped
ingredients: #mc only supports amount of 1 currently as ingredients.
'57': 'a'
shape:
- 'aaa'
results:
#64 Endstone.
'419': 1

Now that brings me to next question can the result be a weapon with enchants on it ?

commented

Comment by Revdutchie

Nevermind, I see that there is a wiki page for that since 2 weeks :-) Great job

commented

Comment by me4502

The wiki page has been there since June last year?
The way the recipes are supposed to work, is with 'wood:2': 3, not with 3 separate copies of it being entered. What you are using is not the default craftbook custom-crafting file, here is a copy of the default: http://pastebin.com/uzmqeCLr

commented

Comment by Revdutchie

Ok, please look at http://wiki.sk89q.com/wiki/CraftBook/Custom_crafting#Special_Data
and scroll down to the example, cause that is what I used.

commented

Comment by me4502

Uh.. it looks like someone messed up my example.

commented

Comment by Revdutchie

Ok, so it was not me going insane :-)

commented

Comment by me4502

Did this work after making the changes?

commented

Comment by Revdutchie

Yes, but now I have an issue with name and lore. I see I opened a new topic for that, I could have stayed here sorry.

You answered that there is a bug in 1.7 for name and lore, but can you confirm that in the basics below script is ok ?

crafting-recipes:
shapeexample:
type: shaped
ingredients: #mc only supports amount of 1 currently as ingredients.
'278|Stone Crusher|No block will stop you now.': 'a'
shape:

  • 'aaa'
    results:
    '293;DIG_SPEED:3|Expensive Hoe|Not for the poor|It be expensive': 1