Minecraft Blogs / Tutorial

Lets Make A Mod! Ep.5 Texturing (Forge Addition)

  • 399 views, 1 today
  • 2
  • 0
lilpsyco99's Avatar lilpsyco99
Level 43 : Master Modder
52
Hello my beautiful people, today i show you how to texture your minecraft forge mod! Now remeber the image has to be 16x16! For the texture to work correctly! ok now on to the description!! Now before you read let me say I put alot of work into this description :) ok continue

SpriteSheet Download: tinypic.com/view.php?pic=2ut5ff6&s=6

Textures
-----------------------------------------------------------------------------
this tutorial will cover the way that i use textures. this way may be different from methods you have used in the past however i find this way the best. lets start off with item textures.
------------------------------------------------------------------------------
Item Textures
------------------------------------------------------------------------------
The textures of an item are made up from two different locations. the first in in the core of your mod file. the line im referring to looks like this BlazeSword = new ItemName(4001).setIconIndex(0).setItemName("Item name");

this code may look familiar. if you look you will notice seticonindex(0) this tells the item
which texture it shuld use from the specified spritesheet.

Now lets look at the items class file. you will need to add the fallowing code if it does not already include it.

public String getTextureFile()
{
return "/yourusername/yourmodname/ItemName.png";
}

this code above tells the game what sprite sheet to use. i will teach more about spritesheets at the bottom of the page.
-----------------------------------------------------------------------------
Block Textures
------------------------------------------------------------------------------
the textures for blocks are dealt with in the BlockYourBlock.class. simply add the following code if it does not exist. the first part tells the block what spritesheet to use and the second part tells the client what spot on the sprite sheet to view. as i mentioned above i will be going over spritesheets below this tut. //gets texture file
public String getTextureFile()
{
return "/YourUserName/YourModName/YourPictureName.png";
}

@SideOnly(Side.CLIENT) //Client side only
public int getBlockTextureFromSide(int i){ //Tells it which texture from the sprite sheet
return 0;
}
----------------------------------------------------------------------------
Spritesheets?
-----------------------------------------------------------------------------
A sprite sheet is a 256x256 image that is sectioned into 16x16 groups. when entering a number you are pointing the texture to a group. i have an example image that i use when i mod. it also includes numbers to help you know what number your sprite/texture is. note: both items and blocks use spritesheets.
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome