• • 4/4/12 1:21 pm • 5 logs
- 13.6k views • 0 today
- save_alt 862 downloads
- Game Version
- Minecraft 1.2.5
- Progress
- 100% complete
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";
}
}
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
245220
7



Have something to say?
But i gonna let this mod die with next mc version, because there is a way with modloader to add blocks in creative.