#ItemFilter method issue

4 messages · Page 1 of 1 (latest)

novel robin
#

Hi, I am having a bit of a struggle with replacing loot in LootJS.

This is what the log says:
[12:15:34] [ERROR] ! lootJS.js#9: Error in 'LootJS.modifiers': dev.latvian.mods.rhino.EvaluatorException: Can't find method com.almostreliable.lootjs.core.filters.ItemFilter.item(string).

This is what I did:
event.addTableModifier(LootType.CHEST).replaceLoot(ItemFilter.item("minecraft:iron_ingot"), "minecraft:iron_nugget")

Am I using it wrong?

For reference:
This is the Filter example from the documentation:
ItemFilter.item("minecraft:diamond")

This is the example from the wiki on how to replace:
event.addTableModifier("minecraft:chests/simple_dungeon").replaceLoot(ItemFilter.equipmentSlot("mainhand"), "minecraft:diamond")

formal dewBOT
#

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

novel robin
#

I am retarded, I just noticed I dont need a filter since I can just pass the item as a string directly when replacing lol

#

But still am wondering why I can't use the filter anyways? why would lootJS care if I target an item as a string or via filters