How to add your own Achievements
In these tutorials you'll mainly need Shockah's Api. This is needed because it makes modding a whole lots easier with adding unusual stuff.
Firstly you will need to add the achievement page aka The ACPage.
This is what the backgruond will look like if you want to add this to your mod then you'll be able to mess around with the description/textures of the page.
Call This Java File: ExampleACPage.java
package net.minecraft.src;
import java.util.Random;
public class ExampleACPage extends ACPage
{
public ExampleACPage()
{
super("Example Achievements");//This is the name of the achievements page. Right now it will say "Example Achievements" you can change this to "My Added Achievements"(This will probably make you feel good).
}
public int bgGetSprite(Random random, int i, int j)
{//This spoiler will give the textures of the page. You can change the names to other names such as you could change the "Block.sand.blockIndexInTexture to Block.glowStone.blockIndexInTexture" this will turn the sand on the page into the Glow Stone Block
int k = Block.sand.blockIndexInTexture;
int l = random.nextInt(1 + j) + j / 2;
if(l > 37 || j == 35)
{
k = Block.bedrock.blockIndexInTexture;
} else
if(l == 22)
{
k = random.nextInt(2) != 0 ? Block.oreRedstone.blockIndexInTexture : Block.oreDiamond.blockIndexInTexture;
} else
if(l == 10)
{
k = Block.oreIron.blockIndexInTexture;
} else
if(l == 8)
{
k = Block.oreCoal.blockIndexInTexture;
} else
if(l > 4)
{
k = Block.stone.blockIndexInTexture;
} else
if(l > 0)
{
k = Block.dirt.blockIndexInTexture;
}
return k;
}
}
Call This Java File: ExampleAchievement.java
package net.minecraft.src;
public class ExampleAchievements
{
public ExampleAchievements()
{
example = (new Achievement(500, "example",
0, 0//These are the co-ordinates of where it is located
, Block.dirt,//Right now the icon that will appear will be a dirt block, you can change this to the block you want.
null//This is the other achievement that it requires right now this lonely little achievement will be sitting in the middle of the page.
//If you want it to require an achievement from the other achievement page(The In-game Ones)
//Then you'll need to replace "null" with this "AchievementList.mineWood" this means that you will need to have gotten some wood before you can acquire this.
)).registerAchievement();
ModLoader.AddAchievementDesc(example,
"Example Achievement",//This will be what it says when you read it. Like it would say
//Achievement Get!
//Example Achievement
//This is able to be changed what you would like it to say.
"Activate Your Example Achievement");//This is the info that the game will give you when you have not gotten it and hover your mouse over it.
ExampleACPage exampleacpage = new ExampleACPage();
exampleacpage.addAchievements(new Achievement[] {
example
});
}
public static final int acOff = 500;
public static Achievement example;
}
Ok so that is how to make an achievement. I think you would be able to figger out how to add another one.
If you have truobles adding another just tell me and I'll add it in.
Here's one. I want to know how to modify your health so that you can only have a maximum of 5 hearts or 10 halves of hearts. I don't need an in-depth guide, just need to know where to look.
So.. Where would I go about looking for this? Thanks for any help :tongue.gif:
Rollback Post to RevisionRollBack
Proud owner of Freaking Tutorials. Help out the cause and post some Freaking Tutorials.
ClumsyRecon's Modding Tutorials
-TUTORIALS-
-(Waiting for the poll to end on the 13th of September)
If you want to see my mod that I'm working on click on my signature down below.
Keep tuned and remeber that your votes will add up to a tutorial.
:tongue.gif:
In these tutorials you'll mainly need Shockah's Api. This is needed because it makes modding a whole lots easier with adding unusual stuff.
Firstly you will need to add the achievement page aka The ACPage.
This is what the backgruond will look like if you want to add this to your mod then you'll be able to mess around with the description/textures of the page.
package net.minecraft.src;
import java.util.Random;
public class ExampleACPage extends ACPage
{
public ExampleACPage()
{
super("Example Achievements");//This is the name of the achievements page. Right now it will say "Example Achievements" you can change this to "My Added Achievements"(This will probably make you feel good).
}
public int bgGetSprite(Random random, int i, int j)
{//This spoiler will give the textures of the page. You can change the names to other names such as you could change the "Block.sand.blockIndexInTexture to Block.glowStone.blockIndexInTexture" this will turn the sand on the page into the Glow Stone Block
int k = Block.sand.blockIndexInTexture;
int l = random.nextInt(1 + j) + j / 2;
if(l > 37 || j == 35)
{
k = Block.bedrock.blockIndexInTexture;
} else
if(l == 22)
{
k = random.nextInt(2) != 0 ? Block.oreRedstone.blockIndexInTexture : Block.oreDiamond.blockIndexInTexture;
} else
if(l == 10)
{
k = Block.oreIron.blockIndexInTexture;
} else
if(l == 8)
{
k = Block.oreCoal.blockIndexInTexture;
} else
if(l > 4)
{
k = Block.stone.blockIndexInTexture;
} else
if(l > 0)
{
k = Block.dirt.blockIndexInTexture;
}
return k;
}
}
Call This Java File: ExampleAchievement.java
package net.minecraft.src;
public class ExampleAchievements
{
public ExampleAchievements()
{
example = (new Achievement(500, "example",
0, 0//These are the co-ordinates of where it is located
, Block.dirt,//Right now the icon that will appear will be a dirt block, you can change this to the block you want.
null//This is the other achievement that it requires right now this lonely little achievement will be sitting in the middle of the page.
//If you want it to require an achievement from the other achievement page(The In-game Ones)
//Then you'll need to replace "null" with this "AchievementList.mineWood" this means that you will need to have gotten some wood before you can acquire this.
)).registerAchievement();
ModLoader.AddAchievementDesc(example,
"Example Achievement",//This will be what it says when you read it. Like it would say
//Achievement Get!
//Example Achievement
//This is able to be changed what you would like it to say.
"Activate Your Example Achievement");//This is the info that the game will give you when you have not gotten it and hover your mouse over it.
ExampleACPage exampleacpage = new ExampleACPage();
exampleacpage.addAchievements(new Achievement[] {
example
});
}
public static final int acOff = 500;
public static Achievement example;
}
Ok so that is how to make an achievement. I think you would be able to figger out how to add another one.
If you have truobles adding another just tell me and I'll add it in.
:smile.gif:
EDIT: sorry didnt realize i was bumping :/
Adding some now and there is already an achievement one that should work.
So.. Where would I go about looking for this? Thanks for any help :tongue.gif: