Magic

Magic

190k Downloads

CheckInventory doesn't check damaged items correctly

NightScythe1 opened this issue ยท 2 comments

commented

As mentioned in issue #1191 the CheckInventory action has trouble with certain items. I have narrowed this down to how it reads damaged/durability on items.
2023-07-11_03 11 28
As shown in the image, magic will read an undamaged item as "item", but a damaged item as "item:damage" rather than just "item".
This means that in order to check an item irrespective of its damage/durability value, you would need to have a check action for every instance of damage, for example on a Netherite Sword, you'd need to check for "netherite_sword:1" through to "netherite_sword:2031"
Even in the slimmest possible version of writing this for values 1 through 2031 in config:

    - class: CheckInventory
      item: netherite_sword:damage
      actions:

you would end up with 2031 different actions and 6093 different lines.
My question is if it would be possible to add a parameter such as 'require_nbt' or 'require_damage' or such to allow us to choose whether our CheckInventory needs to check for specific damage values, in order to prevent lengthy code/configs?

commented

Try setting material_only: true in the action parameters

commented

This seems to be working, thanks so much!!