Create Mechanical Extruder

Create Mechanical Extruder

1M Downloads

Chance-based outputs in kubejs?

4AC11 opened this issue ยท 6 comments

commented

When making other Create recipes, I have been able to make certain outputs chance-based, for example:
event.recipes.createCrushing([
'5x geode:wrappist_shard',
Item.of('geode:wrappist_shard').withChance(0.5),
], 'geode:wrappist_cluster')

The "withChance" bit at the end allows me to make the chance of output 50%

I'm not sure if I'm just doing it wrong, but I have this script here:
event.recipes.createMechanicalExtruderExtruding(Item.of('minecraft:slime_ball').withChance(0.05),[
Fluid.of('minecraft:water'),
Fluid.of('create_things_and_misc:slime')]).withCatalyst('minecraft:slime_block')

I like the recipe, but want it to give less output because it seems way too overpowered for how much SU the extruder consumes. My first thought was to add a low chance for the output.

The recipes remains the same (giving one slimeball per bonk) no matter whether the "withChance" is there or not. If this is a problem of me not typing the script right, please tell me, but I figure this is probably just a matter of the Extruder not supporting chance-based outputs.

commented

I'm looking two interesting ways to solve it. I'm planing to implement both.

  1. withChance for the output.
  2. num of bonks required.

@4AC11 What do you think? any idea to add?

Thank!

commented

There's no support for chance based outputs.

commented

both seems good to me @oierbravo

commented

@oierbravo Both of those would be very helpful and would solve my issues.

commented

Pushed withChance support. Both in the recipes and kubejs.
Work like other create blocks.

commented

Pushed withChance support. Both in the recipes and kubejs. Work like other create blocks.

How can this implement?