Solved Custom model data

Discussion in 'Spigot Plugin Development' started by AlonsoAliaga, Jan 29, 2020.

Thread Status:
Not open for further replies.
  1. Im currently making resource packs for some of my plugins that "add" new items to the game, scrolls, crystals, etc..
    However when i use one of them, all works correctly, but when using both at the same time, only one works, and the other doesnt.

    Both resource packs modifies PAPER texture based on custom model data.

    1st one uses:
    Code (Text):
    {
        "parent": "item/generated",
        "textures": {
            "layer0": "item/paper"
        },
        "overrides": [
            {"predicate": {"custom_model_data":9801001}, "model": "btscrolls:item/teleport_new"},
            {"predicate": {"custom_model_data":9801002}, "model": "btscrolls:item/teleport_used"},
            {"predicate": {"custom_model_data":9801003}, "model": "btscrolls:item/instant_teleport_new"},
            {"predicate": {"custom_model_data":9801004}, "model": "btscrolls:item/instant_teleport_used"}
        ]
    }
    and the 2nd uses:
    Code (Text):
    {
        "parent": "item/generated",
        "textures": {
            "layer0": "item/paper"
        },
        "overrides": [
            {"predicate": {"custom_model_data":9802009}, "model": "brscrolls:item/scroll_of_restoration"}
        ]
    }
    when using only one, they work. But when using both, only the 1st one shows models.

    With both texture packs:
    [​IMG]

    Switching order of both texture packs:
    [​IMG]
    Now the second one is first, and it works, but it modifies items with custom model data not specified in the pack.

    With only the 2nd one:
    [​IMG]
    Resource pack modifies paper with a different custom model data than the one specified in the texture pack enabled.

    It doesnt affect papers without model data or with model data lower than the one in the active texture pack.
    [​IMG]

    Is not possible to use 2 texture packs that modifies one material texture based on different custom model data? Or i need to specify something in the code?

    i wish someone can understand and help me :D
     
  2. if you have two files overriding the same one in the base game (in this paper.json), one of them has to take priority.

    try merging the contents of the paper.json files you have in each resource pack into one, then it should work.

    imagine it like having two resource packs that try to override the same texture file, for example cobbelstone.png. if each resource pack were to provide 50 % of the texture each, minecraft still wouldnt bother to merge the textures for you and just give priority to one of them
     
  3. Yeah i figured out that while being out of home, however the idea is to have 2 different resources packs, not just one resource pack.
    The override should modify specify the specific material with the model data specified, however i believe that the part
    Code (Text):
        "textures": {
            "layer0": "item/paper"
        },
    is making every paper with a custom model data not specified in "overrides" to use "item/paper".
    However, removing that, removes the texture and it looks like air (no image, just numbers if stacked)

    Any idea how to make it work without making just one texture pack?
     
  4. evidently you can't do what you're looking for, sorry.
    the client just doesn't work like that
     
  5. does the "Custom Model Data" work in 1.12.2? ;-;
     
  6. No. Only 1.14+

    Closed
     
Thread Status:
Not open for further replies.