[New feature]: Target multiple items #3

Closed
opened 2025-03-15 23:39:19 +00:00 by Disketaa · 5 comments
Disketaa commented 2025-03-15 23:39:19 +00:00 (Migrated from github.com)

I tried the other mod "Item Components". I liked how you can target a group of items in one file. For example, when I need to change durability for all iron tools. (Also for the tools that isn't from minecraft namespace)

It's quite convenient
but I anyway sticks to your mod, cause I'm finding "Item Components" kinda frozen

Describe the solution you'd like

https://modrinth.com/mod/item-components

Describe alternatives you've considered

https://modrinth.com/mod/item-components

Additional context

No response

### Is your feature request related to a problem? Please describe. I tried the other mod "Item Components". I liked how you can target a group of items in one file. For example, when I need to change durability for all iron tools. (Also for the tools that isn't from minecraft namespace) It's quite convenient but I anyway sticks to your mod, cause I'm finding "Item Components" kinda frozen ### Describe the solution you'd like https://modrinth.com/mod/item-components ### Describe alternatives you've considered https://modrinth.com/mod/item-components ### Additional context _No response_
Awakened-Redstone commented 2025-03-16 00:39:27 +00:00 (Migrated from github.com)

That can be done trough tag targeting on the 1.0.0 version
it's not yet documented (since it's still an alpha) but you can add a "target" to the file and reference a tag, a specific item or even a wildcard

The wildcard feature is still a beta and currently only works to apply components to

  • a given namespace: namespace:*
  • or everything: *

an example file is

{
"target": "#minecraft:iron_tools",
  "add": {
    "max_damage": 150,
    "minecraft:tool": {
      "default_mining_speed": 25,
      "damage_per_block": 20,
      "rules": [
        {
          "blocks": ["#minecraft:incorrect_for_iron_tool"],
          "correct_for_drops": false
        },
        {
          "blocks": ["#minecraft:mineable/pickaxe"],
          "correct_for_drops": true
        }
      ]
    }
  }
}

Your use case will require a custom tag, but that can be easily added trough a datapack

That can be done trough tag targeting on the 1.0.0 version it's not yet documented (since it's still an alpha) but you can add a "target" to the file and reference a tag, a specific item or even a wildcard The wildcard feature is still a beta and currently only works to apply components to - a given namespace: `namespace:*` - or everything: `*` an example file is ```json { "target": "#minecraft:iron_tools", "add": { "max_damage": 150, "minecraft:tool": { "default_mining_speed": 25, "damage_per_block": 20, "rules": [ { "blocks": ["#minecraft:incorrect_for_iron_tool"], "correct_for_drops": false }, { "blocks": ["#minecraft:mineable/pickaxe"], "correct_for_drops": true } ] } } } ``` Your use case will require a custom tag, but that can be [easily added trough a datapack](https://minecraft.wiki/w/Tag)
Disketaa commented 2025-03-16 01:03:52 +00:00 (Migrated from github.com)

Interesting, thanks!

Interesting, thanks!
Disketaa commented 2025-03-19 12:42:45 +00:00 (Migrated from github.com)

Ohh, I tried to change durability for tag, and mining speed for pickaxe.

The pickaxe in the tag too. And I sadly can't change one item twice.

For example, this is Pickaxe:

{
  "add": {
    "minecraft:tool": {
      "rules": [
        {
          "blocks": "#minecraft:incorrect_for_stone_tool",
          "correct_for_drops": false
        },
        {
          "blocks": "#minecraft:mineable/pickaxe",
          "correct_for_drops": true,
          "speed": 4
        }
      ]
    },
    "minecraft:attribute_modifiers": {
      "modifiers": [
        {
          "type": "minecraft:generic.attack_damage",
          "id": "minecraft:base_attack_damage",
          "amount": 3,
          "operation": "add_value",
          "slot": "mainhand"
        },
        {
          "type": "minecraft:generic.attack_speed",
          "id": "minecraft:base_attack_speed",
          "amount": -2.7,
          "operation": "add_value",
          "slot": "mainhand"
        }
      ]
    }
  }
}

This is for tag:

{
"target": "#bronze:bronze_tools",
  "add": {
    "max_damage": 150
  }
}

Pickaxe in the tag but its components can't be edited from multiple file. Durability will be applied only if I remove Pickaxe.json

I know that I could write durability component in each tool. But it would be nice to have some convenience

Ohh, I tried to change durability for tag, and mining speed for pickaxe. The pickaxe in the tag too. And I sadly can't change one item twice. For example, this is Pickaxe: ``` { "add": { "minecraft:tool": { "rules": [ { "blocks": "#minecraft:incorrect_for_stone_tool", "correct_for_drops": false }, { "blocks": "#minecraft:mineable/pickaxe", "correct_for_drops": true, "speed": 4 } ] }, "minecraft:attribute_modifiers": { "modifiers": [ { "type": "minecraft:generic.attack_damage", "id": "minecraft:base_attack_damage", "amount": 3, "operation": "add_value", "slot": "mainhand" }, { "type": "minecraft:generic.attack_speed", "id": "minecraft:base_attack_speed", "amount": -2.7, "operation": "add_value", "slot": "mainhand" } ] } } } ``` This is for tag: ``` { "target": "#bronze:bronze_tools", "add": { "max_damage": 150 } } ``` Pickaxe in the tag but its components can't be edited from multiple file. Durability will be applied only if I remove Pickaxe.json I know that I could write durability component in each tool. But it would be nice to have some convenience
Awakened-Redstone commented 2025-03-19 19:06:57 +00:00 (Migrated from github.com)

oh, I'll look into it, that was an oversight on my side

oh, I'll look into it, that was an oversight on my side
Awakened-Redstone commented 2025-03-20 20:45:48 +00:00 (Migrated from github.com)

Ohh, I tried to change durability for tag, and mining speed for pickaxe.

The pickaxe in the tag too. And I sadly can't change one item twice.
[...]
Pickaxe in the tag but its components can't be edited from multiple file. Durability will be applied only if I remove Pickaxe.json

I know that I could write durability component in each tool. But it would be nice to have some convenience

Fixed. They now also load on a given order, with wildcards first, than tags, than items, and all are sorted alphabetically

> Ohh, I tried to change durability for tag, and mining speed for pickaxe. > > The pickaxe in the tag too. And I sadly can't change one item twice. > [...] > Pickaxe in the tag but its components can't be edited from multiple file. Durability will be applied only if I remove Pickaxe.json > > I know that I could write durability component in each tool. But it would be nice to have some convenience Fixed. They now also load on a given order, with wildcards first, than tags, than items, and all are sorted alphabetically
Commenting is not possible because the repository is archived.
No description provided.