Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.8.9] Armor Equipted shows no Texture ... -_-(path finding is wrong)

Featured Replies

Posted

Hello Dear Forum,

 

Im stucking at a small problem ...

 

i cant solve it O.o

 

i codet an armor, armor class:

public class BlockUpdateArmorClass extends ItemArmor{

public BlockUpdateArmorClass(String unlocalizedName,ArmorMaterial material, int renderIndex, int armorType) {
        super(material, renderIndex, armorType);
        this.setUnlocalizedName(unlocalizedName);
        
        switch(armorType) {
        case 0: setUnlocalizedName("Test_Armor_Helmet"); break;
        case 1: setUnlocalizedName("Test_Armor_Chestplate"); break;
        case 2: setUnlocalizedName("Test_Armor_Legs"); break;
        case 3: setUnlocalizedName("Test_Armor_Boots"); break;
     
        
        }    
}	       
}

then i created a test material:

public static ArmorMaterial Test_Armor_Material = EnumHelper.addArmorMaterial("Test_Armor_Material", "blockupdate:item", 16, new int[] {3, 8, 6, 3}, 30);

 

then i registered it:

		Test_Armor_Helmet = new BlockUpdateArmorClass("Test_Armor_Helmet", Test_Armor_Material, 1, 0);
	Test_Armor_Chestplate = new BlockUpdateArmorClass("Test_Armor_Chestplate", Test_Armor_Material, 1, 1);
	Test_Armor_Legs = new BlockUpdateArmorClass("Test_Armor_Legs", Test_Armor_Material, 2, 2);
	Test_Armor_Boots = new BlockUpdateArmorClass("Test_Armor_Boots", Test_Armor_Material, 1, 3);

 

		GameRegistry.registerItem(Test_Armor_Helmet, Test_Armor_Helmet.getUnlocalizedName().substring(5));
	GameRegistry.registerItem(Test_Armor_Chestplate, Test_Armor_Chestplate.getUnlocalizedName().substring(5));
	GameRegistry.registerItem(Test_Armor_Legs, Test_Armor_Legs.getUnlocalizedName().substring(5));
	GameRegistry.registerItem(Test_Armor_Boots, Test_Armor_Boots.getUnlocalizedName().substring(5));

 

 

the Json files are alright, here just to proof, the helmet for example:

{
"parent": "builtin/generated",
"textures": {
	"layer0": "blockupdate:item/Test_Armor_Helmet"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

 

and there we go,

 

the problem is at the "Layer" path in the new "Material",

this is the path to my layers :

 

src\main\resources\assets\blockupdate\textures\models\armor

 

names of the Layers:

Test_Armor_Layer1

Test_Armor_Layer2

 

 

  • Author

modid : blockupdate

string: Test_Armor_Layer1

          Test_Armor_Layer2

 

and it dont work :/

  • Author

just edited my class:

 

public class BlockUpdateArmorClass extends ItemArmor{

public BlockUpdateArmorClass(ArmorMaterial material, int renderIndex, int armorType) {
        super(material, renderIndex, armorType);
        
        switch(armorType) {
        case 0: setUnlocalizedName("Test_Armor_Helmet"); break;
        case 1: setUnlocalizedName("Test_Armor_Chestplate"); break;
        case 2: setUnlocalizedName("Test_Armor_Legs"); break;
        case 3: setUnlocalizedName("Test_Armor_Boots"); break;
    
        }  
        
}	    
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
	if (slot == 0  || slot == 1 || slot == 3){
		return "blockupdate:textures/models/armor/Test_Armor_Layer1";
	} else if (slot == 2) {
		return "blockupdate:textures/models/armor/Test_Armor_Layer2";
	} else {
		return null;
	}
}
}

 

in this case i could leave the "PATH" to the layer empty ... but it still doesnt work .. :/ anyone any suggestions?

 

 

just edited my class:

 

public class BlockUpdateArmorClass extends ItemArmor{

public BlockUpdateArmorClass(ArmorMaterial material, int renderIndex, int armorType) {
        super(material, renderIndex, armorType);
        
        switch(armorType) {
        case 0: setUnlocalizedName("Test_Armor_Helmet"); break;
        case 1: setUnlocalizedName("Test_Armor_Chestplate"); break;
        case 2: setUnlocalizedName("Test_Armor_Legs"); break;
        case 3: setUnlocalizedName("Test_Armor_Boots"); break;
    
        }  
        
}	    
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
	if (slot == 0  || slot == 1 || slot == 3){
		return "blockupdate:textures/models/armor/Test_Armor_Layer1";
	} else if (slot == 2) {
		return "blockupdate:textures/models/armor/Test_Armor_Layer2";
	} else {
		return null;
	}
}
}

 

in this case i could leave the "PATH" to the layer empty ... but it still doesnt work .. :/ anyone any suggestions?

The first string is just the name the second string is the path. It would be like this "modid:test_armor" and the actual files need to be lower case.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

OK I FOUND IT!! :D

 

thats to "gabrielbl" and to you "Animefan8888" ,

 

the problem was that i didnt wrote ".png" behind the layer texture ... -_- , i found this at the post from gabriel,

 

so now it work as this:

 

	@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){
	if (slot == 0  || slot == 1 || slot == 3){
		return "blockupdate:textures/models/armor/test_armor_layer1.png";
	} else if (slot == 2) {
		return "blockupdate:textures/models/armor/test_armor_layer2.png";
	} else {
		return null;
	}
}
}

 

 

thanks guys ! :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.