Cannot find function thenAdd
eatenpancreas opened this issue ยท 2 comments
Version
Fabric 1.20.1-2.10.4
Describe the bug!
I'm not sure where this came from, i have multiple mods in my pack but i don't think any would interfere.
My code:
LootJS.modifiers(e => e
.addEntityLootModifier("minecraft:creeper")
.randomChance(0.3)
.thenAdd("minecraft:emerald")
);
[16:22:31] [INIT] KubeJS 2001.6.4-build.114; MC 2001 fabric
[16:22:31] [INIT] Loaded plugins:
[16:22:31] [INIT] - dev.latvian.mods.kubejs.fabric.BuiltinKubeJSFabricPlugin
[16:22:31] [INIT] - dev.latvian.mods.kubejs.fabric.BuiltinKubeJSFabricClientPlugin
[16:22:31] [INIT] - pie.ilikepiefoo.AdditionsPlugin
[16:22:31] [INIT] - pie.ilikepiefoo.fabric.FabricPlugin
[16:22:31] [INIT] - com.almostreliable.morejs.Plugin
[16:22:31] [INIT] - com.almostreliable.lootjs.kube.LootJSPlugin
[16:22:31] [INFO] Loaded script server_scripts:drops.js in 0.023 s
[16:22:31] [INFO] Loaded script server_scripts:modified.js in 0.004 s
[16:22:31] [INFO] Loaded script server_scripts:recipes.js in 0.001 s
[16:22:31] [INFO] Loaded 3/3 KubeJS server scripts in 0.036 s with 0 errors and 0 warnings
[16:22:31] [INFO] Scripts loaded
[16:22:31] [INFO] Initializing recipe event...
[16:22:35] [ERROR] ! drops.js#1: Error in 'LootJS.modifiers': TypeError: Cannot find function thenAdd in object com.almostreliable.lootjs.kube.builder.LootActionsBuilderJS@6a1704f2.
[16:22:42] [INFO] Processing recipes...
[16:22:42] [WARN] Failed to parse recipe 'ironchests:netherite_barrel[minecraft:smithing_transform]'! Falling back to vanilla: Ingredient 'base' can't be empty!
[16:22:42] [WARN] Failed to parse recipe 'betterend:guide_book[minecraft:crafting_shaped]'! Falling back to vanilla: ItemStack 'result' can't be empty!
[16:22:42] [WARN] Failed to parse recipe 'vivecraft:jumpboots[minecraft:crafting_shaped]'! Falling back to vanilla: ItemStack 'result' can't be empty!
[16:22:42] [WARN] Failed to parse recipe 'incendium:upgrade_elytra[minecraft:smithing_transform]'! Falling back to vanilla: Ingredient 'template' can't be empty!
[16:22:42] [WARN] Failed to parse recipe 'vivecraft:climbclaws[minecraft:crafting_shaped]'! Falling back to vanilla: ItemStack 'result' can't be empty!
[16:22:42] [WARN] Failed to parse recipe 'ironchests:netherite_chest[minecraft:smithing_transform]'! Falling back to vanilla: Ingredient 'base' can't be empty!
[16:22:42] [WARN] Failed to parse recipe 'ironchests:netherite_upgrade[minecraft:smithing_transform]'! Falling back to vanilla: Ingredient 'base' can't be empty!
[16:22:42] [INFO] Found 16554 recipes in 130.2 ms
[16:22:43] [INFO] Posted recipe events in 184.1 ms
[16:22:43] [INFO] Added 1 recipes, removed 0 recipes, modified 2 recipes, with 0 failed recipes in 51.23 ms
[16:22:51] [INFO] Server resource reload complete!
Crash Report
No response
Log
No response
Additional Context
Yes
Modifications
No response
Did the issue happen in singleplayer or on a server?
Singleplayer
.thenAdd
is 1.18 syntax, 1.19 syntax is addLoot
which can be seen on the wiki right here: https://github.com/AlmostReliable/lootjs/wiki/1.19.2-Actions#addlootitems
Make sure to select the right version on the right side on the wiki.
A Minecraft mod for packdevs to easily modify the loot system with KubeJS. - AlmostReliable/lootjs