Jump to content

Texturing Items


larson377

Recommended Posts

so id like to begin by saying im a complete noob at coding in java, so the most literal explanation would be the most helpful thing for me. here's the link to the youtube series im watching to help me make a basic item

here's my entire item class:

package com.larson377.OddBlocks.Items;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class CopperCoin extends Item {


public CopperCoin(int i) {

	this.setUnlocalizedName("Copper Coin");
	this.setTextureName("OddBlocks:123");
	this.setCreativeTab(CreativeTabs.tabMisc);

}



}

 

and here's my main java class:

package com.larson377.OddBlocks;

import net.minecraft.item.Item;

import com.larson377.OddBlocks.Items.CopperCoin;
import com.larson377.OddBlocks.lib.ProxyCommon;
import com.larson377.OddBlocks.lib.References;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = References.MODID, version = References.VERSION)
public class OddBlocks
{
@SidedProxy(clientSide = References.Client, serverSide = References.Common)

public static ProxyCommon proxy;

//Items

public static Item CopperCoin = new CopperCoin(4999);



    @EventHandler 
    public void init(FMLInitializationEvent event)
    {
    	
    }
    
    @EventHandler 
    public void load(FMLInitializationEvent event)
    {
    	proxy.registerRenderInformation();
    	
    }
    public OddBlocks () {
    	//Item Registry
    	GameRegistry.registerItem(CopperCoin, "Copper Coin");
        LanguageRegistry.addName(CopperCoin, "Copper Coin");
    }
}

my end goal here is to get the darn coin textured. 123 is the basic name i gave my png file, its 16x16 pixels.

Learning to mod, plays with mods!

Link to comment
Share on other sites

The format for the setTextureName() should be as follows.

 

(Probably not what you want) Using the Unlocalized name for textures ----        this.setTextureName("YourModID" + ":" + getUnlocalizedName().substring(5));

(Probably what you want) Having a separate texture name ----                          this.setTextureName("YourModID" + ":" + "YourTextureName");

 

Assuming your modid is OddBlocks it looks like you have everything set up correctly.

 

The path you need for your item textures is as follows ----  root/src/main/resources/textures/items(Your PNG file in here)        (root being where your gradlew batch file is)

 

 

 

Link to comment
Share on other sites

i did exactly as you said, i double checked my modID is OddBlocks, put it in the correct folder as you stated, but it still doesnt work. any ideas on why that is?

heres my new item class:

package com.larson377.OddBlocks.Items;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class CopperCoin extends Item {


public CopperCoin(int i) {

	this.setUnlocalizedName("Copper Coin");
	this.setTextureName("OddBlocks" + ":" + "123");
	this.setCreativeTab(CreativeTabs.tabMisc);

}



}

 

and yes, my coin is actually called 123.png.

Learning to mod, plays with mods!

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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