Jump to content

1.8 Creative Tabs?


TheDogePwner

Recommended Posts

Hi,

 

I have been working on a creative tab for Minecraft. It shows up in the creative inventory, but it has no texture (pink and black squares). I tried:

public Item getTabIconItem() {
	return UltraCraft.steelIngot;
}

And here is the code for SteelIngot:

 

package uc.items;

import net.minecraft.item.Item;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import uc.mainmod.UltraCraft;

public class SteelIngot extends Item {
public SteelIngot() {
	setMaxStackSize(64);
	setCreativeTab(UltraCraft.mechanicalItemsTab);
	setUnlocalizedName("SteelIngot");
}
}

 

 

Here is the .json file for SteelIngot:

{
"parent": "builtin/generated",
"textures": {
"layer0": "UltraCraft:textures/items/SteelIngot"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

Sup bruh.

Link to comment
Share on other sites

I think you also need to register the item renderer. In the init handling method of your client proxy, you need something like this:

 

        RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();

        renderItem.getItemModelMesher().register(yourItem, 0, new ModelResourceLocation("yourmodid:" + yourItem.getUnlocalizedName().substring(5), "inventory"));

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Assuming my modid is UltraCraft, and my item is called steelIngot, and the unlocalizedName is "SteelIngot", wouldn't the code be:

 

renderItem.getItemModelMesher().register(steelIngot, 0, new ModelResourceLocation("UltraCraft:models/item/" + yourItem.getUnlocalizedName(), "inventory"));

 

My .json is called SteelIngot.json, and it's located in src\main\resources\assets\UltraCraft\models\item.

Sup bruh.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Ho installato Forge 1.20.2, ho cliccato col tasto sinistro due volte su installer.jar, non si apre e crea solo un file .log Il file contiene: JVM info: Oracle Corporation - 1.8.0_401 - 25.401-b10 java.net.preferIPv4Stack=true Current Time: 27/02/2024 18:18:10 Host: files.minecraftforge.net [51.79.83.165] Host: maven.minecraftforge.net [51.79.83.165] Host: libraries.minecraft.net [13.107.213.45, 13.107.246.45] Host: launchermeta.mojang.com [13.107.246.45, 13.107.213.45] Host: piston-meta.mojang.com [13.107.246.45, 13.107.213.45] java.net.UnknownHostException: authserver.mojang.com     at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)     at java.net.InetAddress$2.lookupAllHostAddr(Unknown Source)     at java.net.InetAddress.getAddressesFromNameService(Unknown Source)     at java.net.InetAddress.getAllByName0(Unknown Source)     at java.net.InetAddress.getAllByName(Unknown Source)     at java.net.InetAddress.getAllByName(Unknown Source)     at net.minecraftforge.installer.DownloadUtils.getIps(DownloadUtils.java:290)     at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:120) Exception in thread "main"  java.lang.NullPointerException     at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:120)
    • Suddenly the installer stopped working, both forge and neoforge, I've tested it on almost all versions of java and it didn't solve my problem.] Here is the log that appears after trying to open the file: JVM info: Oracle Corporation - 21.0.2 - 21.0.2+13-LTS-58 java.net.preferIPv4Stack=true Current Time: 27/02/2024 13:55:14 Host: maven.neoforged.net [172.67.165.187, 104.21.89.226] Host: libraries.minecraft.net [13.107.246.33, 13.107.213.33] Host: launchermeta.mojang.com [13.107.246.33, 13.107.213.33] Host: piston-meta.mojang.com [13.107.246.33, 13.107.213.33] java.net.UnknownHostException: Este host nᅢᆪo ᅢᄅ conhecido (authserver.mojang.com)     at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)     at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)     at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1211)     at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1828)     at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1139)     at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1818)     at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1688)     at net.minecraftforge.installer.DownloadUtils.getIps(DownloadUtils.java:296)     at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:124) Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because the return value of "net.minecraftforge.installer.DownloadUtils.getIps(String)" is null     at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:124)   If anyone knows how to solve this please tell me.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.