Chance-based outputs in kubejs?
4AC11 opened this issue ยท 6 comments
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.
I'm looking two interesting ways to solve it. I'm planing to implement both.
withChance
for the output.- num of bonks required.
@4AC11 What do you think? any idea to add?
Thank!
both seems good to me @oierbravo
@oierbravo Both of those would be very helpful and would solve my issues.
Pushed withChance
support. Both in the recipes and kubejs.
Work like other create blocks.