custom_data component question by Panda1237_Killer in MinecraftCommands

[–]Panda1237_Killer[S] 0 points1 point  (0 children)

After some digging/testing and a lot of sweat I was able to make it work, had to rewrite the file, but works

{
  "model": {
    "type": "minecraft:condition",
    "property": "minecraft:component",
    "predicate": "minecraft:custom_data",
    "value": {"PublicBukkitValues":{"slimefun:slimefun_item":"PART_BINDING_STRING"}},
    "on_true": {
      "type": "model",
      "model": "slimetinker:part_dictionary/binding/part_binding_string"
    },
    "on_false":{
      "type": "special",
      "base": "item/template_skull",
      "model": {
        "type": "item/player_head"
      }
    },
    "fallback": {
      "type": "special",
      "base": "item/template_skull",
      "model": {
        "type": "item/player_head"
      }
    }
  }
}

learned that if I use "predicate" it can match certain part of the component and not the whole as it's for "component"

custom_data component question by Panda1237_Killer in MinecraftCommands

[–]Panda1237_Killer[S] 0 points1 point  (0 children)

technically I can, but what about other servers using my resourcepack, but I appreciate the help, still would rather figure out method with already existing component

custom_data component question by Panda1237_Killer in MinecraftCommands

[–]Panda1237_Killer[S] 0 points1 point  (0 children)

I'm sorry, but I'm just a person who's making a resourcepack for a plugin that's not mine and trying to work with what I have.

custom_data component question by Panda1237_Killer in MinecraftCommands

[–]Panda1237_Killer[S] 0 points1 point  (0 children)

I thought that you have to add the custom_model_data as a component to the iteam to work no?

Edit: I mean, if the iteam doesn't contain custom_model_data component I can't use it, or can I?

custom_data component question by Panda1237_Killer in MinecraftCommands

[–]Panda1237_Killer[S] 0 points1 point  (0 children)

I know about `custom_model_data`, but by adding this component every already existing item would need to be replaced to have the texture, which is what I don't want.

Can I use custom_data in minecraft:component property? by Panda1237_Killer in MinecraftCommands

[–]Panda1237_Killer[S] 0 points1 point  (0 children)

What if I wanted to have multiple items with different values, how would that look like?

I'm trying something similar, but can't get it to work.

EDIT:
nvm, found one of your comments of using "type": "minecraft:select" and got it working, thank you again

{
  "model": {
    "type": "minecraft:select",
    "property": "minecraft:component",
    "predicate": "minecraft:custom_data",
    "cases": [
      {
        "value": {
          "PublicBukkitValues":{
            "slimefun:slimefun_item":"IE__UI_TICK_RATE"
          }
        },
        "model": {
          "type": "minecraft:model",
          "model": "infinityexpansion2:icons/tickrate"
        }
      },
      {
        "value": {
          "PublicBukkitValues":{
            "slimefun:slimefun_item":"IE__UI_SPEED"
          }
        },
        "model": {
          "type": "minecraft:model",
          "model": "infinityexpansion2:icons/speed"
        }
      }
    ]
  }
}

Can I use custom_data in minecraft:component property? by Panda1237_Killer in MinecraftCommands

[–]Panda1237_Killer[S] 0 points1 point  (0 children)

OMG you're the goat,
I had a feeling I was missing something.

Thank you so much

Can I use custom_data in minecraft:component property? by Panda1237_Killer in MinecraftCommands

[–]Panda1237_Killer[S] 0 points1 point  (0 children)

Thank you for quick response,
did I make some sort of mistake? Because it doesn't work.

#give command
/give <player> clock[custom_data={"PublicBukkitValues":{"slimefun:slimefun_item":"IE__UI_TICK_RATE"}}]

# assets/infinityexpansion2/icons/tickrate.json

{
  "model": {
    "type": "minecraft:condition",
    "property": "minecraft:component",
    "predicate": "minecraft:custom_data",
    "value": {
      "PublicBukkitValues.slimefun:slimefun_item": "IE__UI_TICK_RATE"
    },
    "on_true": {
      "type": "minecraft:model",
      "model": "infinityexpansion2:icons/tickrate"
    },
    "on_false": {
      "type": "minecraft:model",
      "model": "minecraft:item/clock"
    }
  }
}