Minecraft Mods

Creative API

  • 13,275 views, 2 today
  • 852 downloads, 0 today
  • 6
  • 1
  • 17
pitman-87's Avatar pitman-87
Level 88 : Elite Programmer
1,046
The Creative API can use for adding custom Blocks and Items to the Creative Mode inventory.

User have to install the API like Modloader if they want to use Mods working with this API.

Tutorial for modder:

Install the API like Modloader in the minecraft.jar before using MCP.

Add in the constructor of your mod_ file the following:

add simple blocks:

CreativeAPI.addBlock(yourBlock);

add blocks with subtypes (like wool):

CreativeAPI.addBlock(yourBlock, 1);

add items with subtypes (like dyes or charcoal):

CreativeAPI.addItem(yourItem, 1);

Regular items don't need to add!

Pro-Tipp:

Use try/catch to avoid minecraft crashing, for user they won't play in Creative Mode or install the API.

Example:

public class mod_YourMod extends BaseMod
{

public static final Block yourBlock= new Block(200);

public mod_YourMod ()
{
ModLoader.RegisterBlock(yourBlock);
ModLoader.AddName(yourBlock, "Block Name");

ModLoader.AddRecipe(...);

try
{
CreativeAPI.addBlock(yourBlock);
CreativeAPI.addItem(Item.coal, 1);
} catch (NoClassDefFoundError e)
{
ModLoader.getLogger().fine((new StringBuilder("Creative API not found! ")).toString());
}

}

public String Version()
{
return "1.2.4";
}

}
Progress100% complete
Game VersionMinecraft 1.2.5
Tags

5 Update Logs

Update #5 : by pitman-87 04/04/2012 1:21:29 pmApr 4th, 2012

update 1.2.5
LOAD MORE LOGS

Create an account or sign in to comment.

1
05/27/2012 4:51 am
Level 61 : High Grandmaster Programmer
NuclearBanana
NuclearBanana's Avatar
well, you don't need this api because it automaticly puts it in creative menu
1
05/27/2012 4:59 am
Level 88 : Elite Programmer
pitman-87
pitman-87's Avatar
Only Items!

But i gonna let this mod die with next mc version, because there is a way with modloader to add blocks in creative.
1
06/12/2012 5:51 pm
Level 12 : Journeyman Narwhal
corytrain
corytrain's Avatar
how?
1
05/27/2012 5:27 am
Level 61 : High Grandmaster Programmer
NuclearBanana
NuclearBanana's Avatar
hey pitman. I love ur mods and everything...do you want to be in team with me? that means to make mods together? I'm honest and i never ever told a lie, realy! PM me for an awnser, thanks :D
1
05/27/2012 7:13 am
Level 88 : Elite Programmer
pitman-87
pitman-87's Avatar
Thx, but I have enough projects and I prefer to work alone :)
1
05/27/2012 8:53 am
Level 61 : High Grandmaster Programmer
NuclearBanana
NuclearBanana's Avatar
Oh please, please..anything
1
03/25/2012 4:41 pm
Level 35 : Artisan Pokemon
reece2004
reece2004's Avatar
Video
1
05/21/2012 4:46 am
Level 15 : Journeyman Unicorn
burnner
burnner's Avatar
stupid?
1
03/25/2012 12:42 pm
Level 37 : Artisan Modder
TheRoanldo
TheRoanldo's Avatar
Thanks :D
1
03/04/2012 2:07 pm
Level 1 : New Miner
kristofferlw
kristofferlw's Avatar
i dont understand what its do. can you tel me plz?
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome