SurvivalTabs will allow mod developers to add their own survival tabs that
will correspond with other tabs and will work together side-by-side!
Getting Started
All that you need in order to get started using the mod is to click on the inventory button
that you have set in your minecraft controls!
The default key is E.
For Mod Developers: In the downloads, mod developers will be able to download the API in oreder to create thier own survival tabs!
Downloads:
What Are TheBenefits Of This Mod : This mod will give the option to mod developers to create thier own tabs very easily and fast
without overriding other mod tabs..
How To Setup a New Inventory Tab
This guide will show you how to create your own basic tab!
In this tutorial we will only add the minecraft default inventory and we will not make a new texture and container!
First of all, we need to add the API to the project by right clicking on the source folder "/src/main/Java" and selecting "import".
After that, select "Archive File" from the list in the "General" section. Afterwards, click "Next" and "Browse" for the API archive and click Finish!
screenshots:
Now, we will create the tab-class (use any name you want), I will call mine "InventoryTab". We will extend it with the SurvivalTabs class from our API!
Then, you will have to add the constructor with the two variables, and we will add the unimplemented methods!
In the method "getTabIconItem()" we will return the item that will be on the tab, I will choose a diamond chestplate.
Now, we will add the Container in the "getContainer()" method.
First, I will add a new vairable of Minecraft in oreder to get the player that is currently playing.
Because I will return a new normal player's inventory container that is built in the game's "ContainerPlayer".
Now I want the GUI to present me the player in the black square that we have in the GUI texture.
In the constructor I will add this command..
public static Minecraft mc = Minecraft.getMinecraft();
public InventoryTab(String lable, ResourceLocation guiTexture) {
super(lable, guiTexture);
this.addPlayer(51, 75, 30);
}
@Override
public Item getTabIconItem() {
return Items.diamond_chestplate;
}
@Override
public Container getContainer() {
return new ContainerPlayer(mc.thePlayer.inventory, !mc.theWorld.isRemote, mc.thePlayer);
}
}
Now we will create our own tab from the main class of the mod by using this code of line:
ublic static final SurvivalTabs inventoryTab = new InventoryTab("inventory", new ResourceLocation("textures/gui/container/inventory.png"));
The vraiable name can be as you want..
The first argument is the label name for the tab
(This will need to be registered in the lang file as "itemGroup.LabelName").
The second argument is the resource location of your GUI...
@Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
public class ExampleMod
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.0";
public static final SurvivalTabs inventoryTab = new InventoryTab("inventory", new ResourceLocation("textures/gui/container/inventory.png"));
@EventHandler
public void init(FMLInitializationEvent event)
{
// some example code
System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
}
}
That's it! your tab is ready to go! But don't forget that if you want it to work you need to add the SurvivalTabs mod to your mods folder.
The problem is this function in your portal block:
public static boolean tryToCreatePortal(World par1World, int par2,int par3, int par4)
{
return false;
}
You need in the method above to check if there is a portal in the shape you wanted from the blocks you wanted and if yes that it will set the portal block in the place it needs to be..
I made a mod with API, so just for trying I took the api and placed him inside another mod and when I run it evrything is GREAT!
But when I adding the main mod of the API to the mods folder inside the project and run it from eclipse, the game is crashing because an error inside the main mod! But when I run the main in Eclipse or From Minecraft Launcher there is no problem!
Crash Log:
---- Minecraft Crash Report ----
// Sorry
Time: 18:42 20/10/14
Description: There was a severe problem during mod loading that has caused the game to fail
cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodError: net.minecraft.client.Minecraft.func_71410_x()Lnet/minecraft/client/Minecraft;
at cpw.mods.fml.common.LoadController.transition(LoadController.java:162)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:692)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:541)
at net.minecraft.client.Minecraft.run(Minecraft.java:867)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at GradleStart.bounce(GradleStart.java:107)
at GradleStart.startClient(GradleStart.java:100)
at GradleStart.main(GradleStart.java:55)
Caused by: java.lang.NoSuchMethodError: net.minecraft.client.Minecraft.func_71410_x()Lnet/minecraft/client/Minecraft;
at com.iTooly.survivaltabs.gui.KeyHandler.<clinit>(KeyHandler.java:22)
at com.iTooly.survivaltabs.SurvivalTabs.init(SurvivalTabs.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691)
... 17 more
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
My Skype account is gavri.k for any problem you can content me there and I can explain what the problem is and how to fix problems like this in the future..
and item that extends ItemSeeds
than when you will register the item he will tell what you need to give him like the block of the crop and on what block you can place the seed like farmland
The bracket before the override is for the public static without it there everything below becomes an error. and i will change the lowercase to a capital O and see if it has any effect
0
then write this command
0
All the classes are in the same file and everying is one in the other!
You can only redo it all and not in MCCreator!
1
Thi code it from the iron golem:
and that what will make your mob attack!
0
will correspond with other tabs and will work together side-by-side!
Getting Started
that you have set in your minecraft controls!
The default key is E.
In the downloads, mod developers will be able to download the API in oreder to create thier own survival tabs!
This mod will give the option to mod developers to create thier own tabs very easily and fast
without overriding other mod tabs..
How To Setup a New Inventory Tab
In this tutorial we will only add the minecraft default inventory and we will not make a new texture and container!
After that, select "Archive File" from the list in the "General" section. Afterwards, click "Next" and "Browse" for the API archive and click Finish!
In the method "getTabIconItem()" we will return the item that will be on the tab, I will choose a diamond chestplate.
First, I will add a new vairable of Minecraft in oreder to get the player that is currently playing.
In the constructor I will add this command..
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerPlayer;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
public static Minecraft mc = Minecraft.getMinecraft();
super(lable, guiTexture);
this.addPlayer(51, 75, 30);
}
public Item getTabIconItem() {
return Items.diamond_chestplate;
}
public Container getContainer() {
return new ContainerPlayer(mc.thePlayer.inventory, !mc.theWorld.isRemote, mc.thePlayer);
}
The first argument is the label name for the tab
(This will need to be registered in the lang file as "itemGroup.LabelName").
The second argument is the resource location of your GUI...
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
public class ExampleMod
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.0";
public static final SurvivalTabs inventoryTab = new InventoryTab("inventory", new ResourceLocation("textures/gui/container/inventory.png"));
@EventHandler
public void init(FMLInitializationEvent event)
{
// some example code
System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
}
}
0
1
You need in the method above to check if there is a portal in the shape you wanted from the blocks you wanted and if yes that it will set the portal block in the place it needs to be..
0
I made a mod with API, so just for trying I took the api and placed him inside another mod and when I run it evrything is GREAT!
But when I adding the main mod of the API to the mods folder inside the project and run it from eclipse, the game is crashing because an error inside the main mod! But when I run the main in Eclipse or From Minecraft Launcher there is no problem!
Crash Log:
The row that eclipse says that there is a problem in from the main mod!:
Hope you guys enjoyed the reading!
0
0
and item that extends ItemSeeds
than when you will register the item he will tell what you need to give him like the block of the crop and on what block you can place the seed like farmland
0
you can write your own code but you should use what minecraft gives you..
0
0
0
the varibals that above the command that I told you to wrote
0
in the method preInit() you need to add for each item this:
0
public static of what?! O.o