Durability Models Halp

Discussion in 'Programming' started by Leniency, Aug 21, 2016.

Thread Status:
Not open for further replies.
  1. So I created a resourcepack using durability models. My durability models work for all tools except for all gold tools. I experimented a bit and found out that the problem was with the file which decided which model to use and not the model files itself. Here is my file with the issue:
    Code (Text):
    {
        "parent": "item/handheld",
        "textures": {
            "layer0": "item/golden_hoe_normal"
        },
        "overrides": [
            { "predicate": {"damaged": 0, "damage": 0}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.030303030303030304}, "model": "item/golden_hoe_dm"},
            { "predicate": {"damaged": 0, "damage": 0.06060606060606061}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.09090909090909091}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.12121212121212122}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.15151515151515152}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.18181818181818182}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.21212121212121213}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.24242424242424243}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.2727272727272727}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.30303030303030304}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.33333333333333337}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.36363636363636365}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.3939393939393939}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.42424242424242425}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.4545454545454546}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.48484848484848486}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.5151515151515151}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.5454545454545454}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.5757575757575758}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.6060606060606061}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.6363636363636364}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.6666666666666667}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.696969696969697}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.7272727272727273}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.7575757575757576}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.7878787878787878}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.8181818181818182}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.8484848484848485}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.8787878787878788}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.9090909090909092}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.9393939393939394}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 0, "damage": 0.9696969696969697}, "model": "item/golden_hoe_normal"},
            { "predicate": {"damaged": 1, "damage": 0}, "model": "item/golden_hoe_normal"}
        ]
    }
    Could someone tell me what is wrong?
     
  2. NathanWolf

    Supporter

    I don't see anything immediately wrong there. I do notice my own files don't have that first line:

    Code (Text):
    { "predicate": {"damaged": 0, "damage": 0}, "model": "item/golden_hoe_normal"},
    Though I can't see why that would cause an issue.
     
  3. NullBlox

    Patron


    You are using the UNBREAKING TAG.
    You will only be able to get that model to show with it having a UNBREAKING TAG.

    Example:
    /give NullBlox minecraft:diamond_hoe 1 1551 {Unbreakable:1} <-- That is how you setup your Pack.

    /give NullBlox minecraft:diamond_hoe 1 1551 <-- this will not work for you with the current format.


    Change your "0" s to "1" s and you should be able to see the non-UNBREAKABLE items.

    The thing is there are 2 ways to do this.
    #1: Replace Default Items.
    #2: Replace Default Items that have a Unbreaking Tag.

    I started with the #1 method and not Im converting to the #2 method myself.
    This allows you to keep your basic defaults and still add multi custom items.

    This site can help you also: http://accidentalgames.com/media/durabilityModels.php
     
  4. The items I am giving myself are diamond hoes with a durability of 1 and the Unbreaking tag. The issue is that the normal model shows but the item I am giving myself have the missing model texture. Also, I used that site to generate my models.
     
  5. NullBlox

    Patron

    You are welcome to contact me on Skype, just shoot me a PM. Im sure we can figure this out.
     
    • Friendly Friendly x 1
  6. Thanks for the help, problem solved.
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.