OtherDrops

226k Downloads

OD doesn't accept multiple levels of the same enchanted tool in the TOOL condition.

ZephORSC opened this issue ยท 2 comments

commented

The TOOL condition in Otherdrops won't properly accept defining an enchanted tool multiple times with multiple enchantments and varying levels of those enchantments. It only accepts the first defined version of the item.

Given the following example:

STEP:
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!LOOT_BONUS_MOBS, DIAMOND_SWORD@!LOOT_BONUS_MOBS#2, DIAMOND_SWORD@!LOOT_BONUS_MOBS#3, DIAMOND_SWORD@!DAMAGE_UNDEAD, IRON_SWORD@!LOOT_BONUS_MOBS#2, IRON_SWORD@!LOOT_BONUS_MOBS#3 ]
      message: "Debug."
      flags: UNIQUE

Here we tell OD that on right clicking a single step, it should print the message "Debug." if using any of the defined tools. However, it only prints the debug message when using a [ DIAMOND_SWORD with Looting 1 ], and [ IRON_SWORD with Looting 2 ], because those are the first instances defined of Diamond sword and Iron sword. Diamond sword with Looting 2, Looting 3, and Smite 1 fail to be recognized, and Iron sword with Looting 3 fails to be recognized.

The alternative solution for now is to do many individual entries of each tool, with each enchantment. For example:

STEP:
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!LOOT_BONUS_MOBS ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!LOOT_BONUS_MOBS#2 ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!LOOT_BONUS_MOBS#3 ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!DAMAGE_UNDEAD ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ IRON_SWORD@!LOOT_BONUS_MOBS#2 ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ IRON_SWORD@!LOOT_BONUS_MOBS#3 ]
      message: "Debug."
      flags: UNIQUE
commented

I'm guessing it would be easier to accept ranges for the enchantment level than to accept multiples of a tool... though, that would add another layer of complexity on top of your already overcomplex syntax...

commented

Actually, I believe it does already support a range :-) I'll have to test
that out later. Although both ways should be working, for consistency.