Jump to content

item was not rendered, but texture was found by game


sawthewhat

Recommended Posts

my english is poor.(i'm a chinese) so I can't express it very well.sorry.

i can sure the texture was found by game. but it not rendered on the item at all

i asked other forge developers for help. but they don't konw how to do either.

i tried to sovle it in all ways i can do. but it still show me a black-purple block

Forge version: 1.10.2-12.18.1.2065 (mc 1.10.2)

please help me to check my code:

 

sawthewhat.keystand.KeyStandMod

package sawthewhat.keystand;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;

@Mod(name = KeyStandMod.MODNAME, version = KeyStandMod.MODVER, modid = KeyStandMod.MODID)
public class KeyStandMod {
public final static String MODID = "keystand";
public final static String MODNAME = "KeyStand";
public final static String MODVER = "1.0";
@SidedProxy(clientSide = "sawthewhat.keystand.ClientProxy",
		serverSide = "sawthewhat.keystand.ServerProxy")
public static ServerProxy proxy;

@EventHandler
public void init(FMLInitializationEvent e) {
	proxy.init();
}
}

 

sawthewhat.keystand.ServerProxy

package sawthewhat.keystand;

import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import sawthewhat.keystand.item.ItemKeyStand;

public class ServerProxy {
protected ItemKeyStand ks;

public void init() {
	ks = new ItemKeyStand();
	ks.setRegistryName("keystand");
	ks.setUnlocalizedName("keystand.keystand");
	GameRegistry.register(ks);
}
}

 

sawthewhat.keystand.ClientProxy

package sawthewhat.keystand;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraftforge.client.model.ModelLoader;

public class ClientProxy extends ServerProxy {
public void init() {
	super.init();
	ModelLoader.setCustomModelResourceLocation(super.ks, 0, new ModelResourceLocation("keystand:keystand", "inventory"));
}
}

 

ItemKeyStand is almost empty

package sawthewhat.keystand.item;

import net.minecraft.item.Item;

public class ItemKeyStand extends Item {

}

 

 

assets/keystand/models/item/keystand.json

{

    "parent":"builtin/generated",

    "textures": {

        "layer0": "keystand:keystand"

    }

}

 

texture is in assets/keystand/textures.

help me to find where is the wrong.thx.

Link to comment
Share on other sites

Don't add your modid to the resource location aka ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation("keystand", "inventory"));

Also you need to have more than 1 JSON for blocks just so you know.

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.

Link to comment
Share on other sites

Also you should be doing all Item/Block stuff in FMLPreInitializationEvent not FMLInitializationEvent.

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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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