Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I've been trying to texture my item (unsuccessfully) and for whatever reason the model thinks that it's a block. I don't have any code that says it's an item block, but I still have no idea how the json texturing system works. This is my json file:

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": "Ancients:items/Rubble"
    },
    "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 ]
        }
    }
}

Also, how can I texture it? I can't seem to figure it out.

The proud(ish) developer of Ancients

It will look like an untextured block until the .JSON file is used to reference the texture.

 

In your assets folder you need another folder called models, in the models folder you need a folder called item, place the Rubble.JSON file in that item folder.

  • Author

Can you not create items the same as in 1.7? (I realize the texturing is different)

The proud(ish) developer of Ancients

This is my food class right now:

 

package com.ProfitOrange.moshiz.init;

import com.ProfitOrange.moshiz.MoShizMain;
import com.ProfitOrange.moshiz.Reference;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class MoShizFoods {



public static Item beefSandwich;



public static void init()
{
	beefSandwich = new ItemFood(8, 0.8F, false).setUnlocalizedName("beefSandwich").setCreativeTab(MoShizMain.tabGems);



}

public static void register()
{
	GameRegistry.registerItem(beefSandwich, beefSandwich.getUnlocalizedName().substring(5));


}

public static void registerRenders()
{
	registerRender(beefSandwich);


}

public static void registerRender(Item item)
{
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));;
}
}

 

Then my preInit method in my main class:

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	MoShizFoods.init();
	MoShizFoods.register();
}

In my ClientProxy class:

@Override
public void registerRenders()
{
	MoShizFoods.registerRenders();
}

  • Author

I essentially have that exact code, except my code doesn't have the extra functions (I make really bad code structure).

The proud(ish) developer of Ancients

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.