#Matching Main Hand Tag LootJS

5 messages · Page 1 of 1 (latest)

gentle stag
#

Heya, basically I want for the required matching item to accept tags in my LootJs script

   event.addBlockLootModifier(/.*:.*_leaves/).randomChance(0.8).matchMainHand(Item.of('#forge:tools/knives').ignoreNBT()).addLoot('kubejs:plant_fiber')```
 
It doesn't seem to work. I tried` Ingreditent.of` instead of `Item.of,` but had no luck.

Any idea how to make it work?
lunar quarryBOT
#

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

left iris
#
event.addBlockLootModifier(Ingredient.of(/.*:.*_leaves/))
  .randomChance(0.8)
  .matchMainHand(Ingredient.of("#forge:tools/knives").ignoreNBT())
  .addLoot("kubejs:plant_fiber")
#

Try this

gentle stag
#

I removed the .ignoreNBT() and it works. Thanks!