Mods Functional

Creative API

  • 13.6k views 0 today
  • save_alt 862 downloads
Game Version
Minecraft 1.2.5
Progress
100% complete
  • 6
  • 2
  • 17
pitman-87
Lvl 86Elite Programmer
1,058
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";
}

}

5 Update Logs

Update #5 : by pitman-87 04/04/2012 1:21:29 pmApril 4, 2012 @ 5:21 pm UTC

update 1.2.5
LOAD MORE LOGS

More like this

  Have something to say?

NuclearBanana
05/27/2012 4:51 am
Level 62 : High Grandmaster Programmer
well, you don't need this api because it automaticly puts it in creative menu
1
pitman-87
05/27/2012 4:59 am
Level 86 : Elite Programmer
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
corytrain
06/12/2012 5:51 pm
Level 12 : Journeyman Narwhal
how?
1
NuclearBanana
05/27/2012 5:27 am
Level 62 : High Grandmaster Programmer
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
pitman-87
05/27/2012 7:13 am
Level 86 : Elite Programmer
Thx, but I have enough projects and I prefer to work alone :)
1
NuclearBanana
05/27/2012 8:53 am
Level 62 : High Grandmaster Programmer
Oh please, please..anything
1
reece2004
03/25/2012 4:41 pm
Level 35 : Artisan Pokémon
Video
1
burnner
05/21/2012 4:46 am
Level 15 : Journeyman Unicorn
stupid?
1
TheRoanldo
03/25/2012 12:42 pm
Level 37 : Artisan Modder
Thanks :D
1
kristofferlw
03/04/2012 2:07 pm
Level 1 : New Miner
i dont understand what its do. can you tel me plz?
1

Welcome