Loading...
Beta Modpages Unclaimed

SurvivalTabs

SurvivalTabs will allow mod developers to add their own survival tabs that will correspond with other tabs and will work together side-by-side!

0 Likes
1532 Downloads
Created by _ForgeUser11981949

Description

Logo

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!

 

What Are The Benefits 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: 

 

1

 

 

2

 

 

3

 

 

4

 

 

 

 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..

this.addPlayer(fromLeftSize, fromTheTop, scale); -> this.addPlayer(51, 75, 30);

InventoryTab Class:

package com.example.examplemod;

import net.minecraft.client.Minecraft;
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;

import com.iTooly.survivaltabs.api.SurvivalTabs;

public class InventoryTab extends SurvivalTabs {

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:

public static final SurvivalTabs inventoryTab = new InventoryTab("inventory", new ResourceLocation("textures/<wbr />gui/container/inventory.png"))<wbr />;

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...

Main Class:

package com.example.examplemod;

import com.iTooly.survivaltabs.api.SurvivalTabs;

import net.minecraft.init.Blocks;
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;

@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.

Result:

1

 

2

 


AD Become Premium to remove Ads!

What means Verified?

  • Compatibility: The mod should be compatible with the latest version of Minecraft and be clearly labeled with its supported versions.
  • Functionality: The mod should work as advertised and not cause any game-breaking bugs or crashes.
  • Security: The mod should not contain any malicious code or attempts to steal personal information.
  • Performance: The mod should not cause a significant decrease in the game's performance, such as by causing lag or reducing frame rates.
  • Originality: The mod should be original and not a copy of someone else's work.
  • Up-to-date: The mod should be regularly updated to fix bugs, improve performance, and maintain compatibility with the latest version of Minecraft.
  • Support: The mod should have an active developer who provides support and troubleshooting assistance to users.
  • License: The mod should be released under a clear and open source license that allows others to use, modify, and redistribute the code.
  • Documentation: The mod should come with clear and detailed documentation on how to install and use it.

AD Become Premium to remove Ads!

How to Install

1

Download Forge & Java

Download Forge from the offical Site or here. If you dont have Java installed then install it now from here. After Downloading Forge you can run the file with Java.

2

Prepare

Lounch Minecraft and select your Forge istallation as Version this will create a Folder called Mods.

3

Add Mods

Type Win+R and type %appdata% and open the .minecraft Folder. There will you find your Folder called Mods. Place all Mods you want to play in this Folder

4

Enjoy

You are now Ready. Re-start your Game and start Playing.

More Mods like this

Mystical Agradditions

Adds tier 6 crops, Tinkers' support, Paxels and more to Mystical Agriculture!

Reborn Storage

Refined Storage add-on adding multi-block crafters and larger disks

Ex Compressum

Ex Nihilo Addon. Attempts to reduce grind by adding pre-automation tools like compressed hammers.