#Do I need the Item.of() for the .withchance() output?

76 messages · Page 1 of 1 (latest)

topaz hemlock
#

I want to write:js event.recipes.createMixing('poppy').withchance(2), ('poppy', 'bone_meal').id('example')
I dont think that is correct but you get the idea.

upper hornetBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

livid jay
#

Yes

#

Unless it's a json recipe

topaz hemlock
#

ok thx

livid jay
#

No probs

topaz hemlock
#

did I write the example rite?

trail violet
topaz hemlock
#

thought so

livid jay
#

You did not. Replace the parenthesis with item id's in them with brackets, and put brackets around your output item

#

event.recipes.createMixing([Item.of('poppy').withchance(2)], ['poppy', 'bone_meal']).id('example')

#

I think

topaz hemlock
#

ohh makes sense

trail violet
#

also, withChance takes a value between 0 and 1

livid jay
#

^

fathom fossilBOT
# trail violet ??codeblock

You can write your code in a codeblock by typing it between the codeblock delimiters:

```js :arrow_left:

onEvent('recipes', e => {
e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

As an example, :arrow_up: will look like this:

onEvent('recipes', e => {
  e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
livid jay
#

Sorry I just got up, too much work 😛

trail violet
#

I would've written the code, but I'm on my phone, it would be a pain for me

livid jay
#

Fair

topaz hemlock
#

by 0 and 1, is it the chance or how many items are outputted?

trail violet
#

the chance

livid jay
#

0.05 is 5%, for example

#

1 is 100%

trail violet
#

^

livid jay
#
event.recipes.createMixing([Item.of('poppy').withchance(0.02)], ['poppy', 'bone_meal']).id('example')```
topaz hemlock
#

How do I write it so only one poppy can output and have a chance for three?

livid jay
#

Just like my code I posted, but with the chance being 0.03

#

Oh

#

Sorry I read wrong

#

again, just got up

topaz hemlock
trail violet
#

['poppy', Item.of('poppy', 2).withChance(0.5)]

#

the output ^

livid jay
#

Sorry you had to write that

trail violet
topaz hemlock
trail violet
#

Yes

livid jay
#

Yes

topaz hemlock
#

ok

livid jay
#

The create addon is extremely picky about it

topaz hemlock
#

event.recipes.createMixing(['poppy', Item.of('poppy', 2).withchance(0.5)], ['poppy'], ['bone_meal]').id('example')
that should be correct?

trail violet
#

?? codeblock

fathom fossilBOT
# trail violet ?? codeblock

You can write your code in a codeblock by typing it between the codeblock delimiters:

```js :arrow_left:

onEvent('recipes', e => {
e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

As an example, :arrow_up: will look like this:

onEvent('recipes', e => {
  e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
trail violet
#

that's wrong

topaz hemlock
#

yep, Forgot abt that

livid jay
#

And no, the inputs need to be in one bracket set

trail violet
#

^

livid jay
#

['poppy', 'bone_meal']

trail violet
livid jay
#

Oops, must've hit it accidentally

topaz hemlock
#
event.recipes.createMixing(['poppy', Item.of('poppy', 2).withchance(0.5)], ['poppy', 'bone_meal]').id('example')```
?
livid jay
#

Yep

#

Oh wait

topaz hemlock
#

YAY, thanks

#

._>

livid jay
#

bone_meal needs the extra '

#

on the end

trail violet
#

also you have a random ] in the string

livid jay
#

yeah

#

Yes

trail violet
#

?? codeblock

fathom fossilBOT
# trail violet ?? codeblock

You can write your code in a codeblock by typing it between the codeblock delimiters:

```js :arrow_left:

onEvent('recipes', e => {
e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

As an example, :arrow_up: will look like this:

onEvent('recipes', e => {
  e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
trail violet
livid jay
#

Lol

trail violet
#

otherwise, seems okay

topaz hemlock
#
event.recipes.createMixing(['poppy', Item.of('poppy', 2).withchance(0.5)], ['poppy', 'bone_meal']).id('example')```
trail violet
#

yep

livid jay
#

Yes perfect

topaz hemlock
#

yay thnks that would of taken for ever for me to figure out lol

livid jay
#

You're welcome

trail violet
#

np :D

livid jay
#

Have a nice day you two

trail violet