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

Hey, I've managed to create following project:

J3WJsqj.png

By following Loremaster's tutorials. I'm currently at the "create a custom item" phase, but my items get texture errors:

12:27:42] [main/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[12:27:42] [main/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[12:27:42] [main/ERROR] [TEXTURE ERRORS]: ==================================================
[12:27:42] [main/ERROR] [TEXTURE ERRORS]:   DOMAIN um
[12:27:42] [main/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[12:27:42] [main/ERROR] [TEXTURE ERRORS]:   domain um is missing 2 textures
[12:27:42] [main/ERROR] [TEXTURE ERRORS]:     domain um has 1 location:
[12:27:42] [main/ERROR] [TEXTURE ERRORS]:       mod um resources at C:\Users\Frederik\Desktop\WorkspaceUno\Mod\bin
[12:27:42] [main/ERROR] [TEXTURE ERRORS]: -------------------------
[12:27:42] [main/ERROR] [TEXTURE ERRORS]:     The missing resources for domain um are:
[12:27:42] [main/ERROR] [TEXTURE ERRORS]:       textures/items/schematic_sign.png.png
[12:27:42] [main/ERROR] [TEXTURE ERRORS]:       textures/items/paste.png.png
[12:27:42] [main/ERROR] [TEXTURE ERRORS]: -------------------------
[12:27:42] [main/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain um
[12:27:42] [main/ERROR] [TEXTURE ERRORS]: ==================================================

As the error suggest I do believe it might be path or name related, but after triple-checking it seems like it's either not that, or I've stared myself blind. I checked the MOD_ID and it is properly put to "um", and all the naming seem to be as it should. Are there any other reasons this could happen? Hopefully someone can spot something, thank you =)

  • Replies 50
  • Views 26.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Your folder name is ítems it should be items.  

  • Also, the way I've set up my mod works perfectly for me, but it treats what should be a exclusively server-side code as (mostly) common code. If your planning on adding a lot methods that should only

Posted Images

1) 

textures/items/schematic_sign.png.png

has two file endings, is this intended?

 

2) You shouldn't add file endings to your json files (don't know if your doing this, the forge log could just be being specific)

 

3)are you prefixing your texture locations with <MODID>:<PATH>

for example my mod's id is wiptech

{
    "parent": "item/generated",
    "textures": {
        "layer0": "wiptech:items/copper_ingot"
    },
    "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]
        }
    }
}

 

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

If that doesn't fix the problem, please post In-game screenshots, the contents of paste.json and your item registration and model registration code 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author

Yea this is my json for the schematic_sign:

{
   "parent": "item/generated",
   "textures": {
       "layer0": "um:items/schematic_sign"
   }
}

 

  • Author

More project info

IGN Image:

MjFPeW9.png

 

RegistryHandler.java:

package com.mta.utzonmod.util.handlers;

import com.mta.utzonmod.init.ModItems;
import com.mta.utzonmod.util.IHasModel;

import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@EventBusSubscriber
public class RegistryHandler {
	@SubscribeEvent
	public static void onItemRegister(RegistryEvent.Register<Item> event) {
		event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
	}
	
	@SubscribeEvent
	public static void onModelRegister(ModelRegistryEvent event) {
		for(Item item : ModItems.ITEMS) {
			if(item instanceof IHasModel) {
				((IHasModel)item).registerModels();
			}
		}
	}
}

 

IHasModel.java:

package com.mta.utzonmod.util;

public interface IHasModel {
	public void registerModels();
}

 

2 minutes ago, Stenbergcsgo said:

((IHasModel)item).registerModels();

 

2 minutes ago, Stenbergcsgo said:

registerModels();

and this does... what?

please post that code

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

This is how I do it

 

@SubscribeEvent
public static void registerModels(ModelRegistryEvent event)
	{
		for (Block block: Blocks.BLOCKS)
		{
			ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
		}

		for (Item item: Items.ITEMS)
		{
			if(!item.getHasSubtypes()) {
				ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
			} else {
              //register items with subtypes
            }
        }
}

 

Blocks is a Block[] with all my blocks in it and Items is an Item[] with all my items in it

 

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author

Code from ItemBase.java overriding the registerModels() function from the IHasModel interface:

package com.mta.utzonmod.items;

import com.mta.utzonmod.Main;
import com.mta.utzonmod.init.ModItems;
import com.mta.utzonmod.util.IHasModel;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class ItemBase extends Item implements IHasModel {

	public ItemBase(String name) {
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(CreativeTabs.MISC);
		
		ModItems.ITEMS.add(this);
	}
	
	@Override
	public void registerModels() {
		
		Main.proxy.registerItemRenderer(this, 0, "inventory");
		
	}
	
}

 

6 minutes ago, Stenbergcsgo said:

Main.proxy.registerItemRenderer(this, 0, "inventory");

this code?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author

Yea I'm pretty new to the minecraft modding, so I'm a bit unsure about some of the functions. I've been following Loremaster's tutorials: 

, so some of the functions go unexplained. :-(

Oh no, they register stuff inside the item class...

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

ItemBase.java

package com.mta.utzonmod.item;
import com.mta.utzonmod.Reference;
import net.minecraft.item.Item;
public class ItemBase extends Item
{
    
    public ItemBase(String name)
    {
        super();
        
        this.setRegistryName(Reference.ID, name);
        this.setUnlocalizedName(name);
    }
      
}

 

ItemPaste.java

package com.mta.utzonmod.item;

public class ItemPaste extends ItemBase
{
	public ItemPaste(String name)
	{
		super(name);
	}
}

 

ModItems.java

package com.mta.utzonmod.init;

import com.mta.utzonmod.item.ItemPaste;
import net.minecraft.item.Item;

public class ModItems {
  public static final ItemPaste PASTE = new ItemPaste("paste");
  
  public static final Item[] ITEMS = {
    PASTE,
  };
  
}

 

Client Registry Class (Client Proxy or similar)

 

@Mod.EventBusSubscriber
public class CLIENT_PROXY_CLASS extends COMMON_PROXY_CLASS_OR_SIMILAR
{
  @SubscribeEvent
    public static void registerModels(ModelRegistryEvent event)
  {
    for (Item item: Items.ITEMS)
    {
      if(!item.getHasSubtypes()) {
        ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
      } else {
        //do stuff
      }
    }
  }
}

 

Edited by Cadiboo
Cleaned up code

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

7 minutes ago, Stenbergcsgo said:

Is that bad?

I'm not sure if its actually that bad, but I know that it leads to less clean code and lots of copy/pasted & repetitive code

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

package com.mta.utzonmod.item;

public class ItemPaste extends ItemBase
{
	public ItemPaste(String name)
	{
		super(name);
	}
}

 

package com.mta.utzonmod.item;

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author

Thanks for your code suggestion, I tried to converting to that, but I am now getting a few errors:

ClientProxy.java:

package com.mta.utzonmod.proxy;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@Mod.EventBusSubscriber
public class ClientProxy extends CommonProxy {
	@SubscribeEvent
	public static void registerModels(ModelRegistryEvent event)
	{
		for (Item item: Items.ITEMS)
		{
			if(!item.getHasSubtypes()) {
				ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
			} else {
//do stuff
}
}
}
}

Error: 

ITEMS can not be resolved or is not a field

 

and my RegistryHandler.java:

package com.mta.utzonmod.util.handlers;

import com.mta.utzonmod.init.ModItems;
import com.mta.utzonmod.util.IHasModel;

import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@EventBusSubscriber
public class RegistryHandler {
	@SubscribeEvent
	public static void onItemRegister(RegistryEvent.Register<Item> event) {
		event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
	}
	
	@SubscribeEvent
	public static void onModelRegister(ModelRegistryEvent event) {
		for(Item item : ModItems.ITEMS) {
			if(item instanceof IHasModel) {
				((IHasModel)item).registerModels();
			}
		}
	}
}

Where I get the error: 

Cannot invoke toArray(Item[]) on the array type Item[]

 

5 minutes ago, Stenbergcsgo said:

@SubscribeEvent public static void onModelRegister(ModelRegistryEvent event) { for(Item item : ModItems.ITEMS) { if(item instanceof IHasModel) { ((IHasModel)item).registerModels(); } } }

Remove this from RegistryHandleer

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

@Mod.EventBusSubscriber
public class COMMON_PROXY_OR_SIMILAR {
  @SubscribeEvent
    public static void registerItems(RegistryEvent.Register<Item> event)
  {	
    event.getRegistry().registerAll(Items.ITEMS);
  }
}

 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Please keep in mind that all of this is how I do it, It might not be the best way, but it looks clean and I can't find any problems with it.

 

For me, my common proxy is a mix of RegistryHandler and Common Proxy, and my Client Proxy is pretty much only used for registering models and renders etc

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author

My classes are currently as such:

ClientProxy.java:
 

package com.mta.utzonmod.proxy;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@Mod.EventBusSubscriber
public class ClientProxy extends CommonProxy {
	@SubscribeEvent
    public static void registerItems(RegistryEvent.Register<Item> event)
  {	
    event.getRegistry().registerAll(Items.ITEMS);
  }
}

and RegistryHandler.java:
 

package com.mta.utzonmod.util.handlers;

import com.mta.utzonmod.init.ModItems;
import com.mta.utzonmod.util.IHasModel;

import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@EventBusSubscriber
public class RegistryHandler {
	@SubscribeEvent
	public static void onItemRegister(RegistryEvent.Register<Item> event) {
		event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
	}
}

however with same errors

  • Author

I don't mind changing the method. My goal is to create a rather simple mod containing 3 custom items that hopefully should end up parsing strings. So it doesn't have to be anything too fancy, just want it to work =)

4 minutes ago, Stenbergcsgo said:

event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));

WHY WHY WHY

NO NO NO

should have seen this earlier

This fails so many ways

1) apparently cant event turn ModItems.ITEMS into an array

maybe because it has to be used like this ModItems.ITEMS.toArray() with nothing inside the ()

2) No idea what it would try to do with (new Item[0]), but it would fail absolutely horribly and fatally.

Do you know java or any other Object Oriented language? if so you will know that toArray(new Item[0]) is completely non-sensical and guaranteed to crash everything

 

event.getRegistry().registerAll(ModItems.ITEMS);

 

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

  • Author

Should I also change the 

 event.getRegistry().registerAll(Items.ITEMS);

to 

 event.getRegistry().registerAll(ModItems.ITEMS);

in the ClientProxy.java?

 

Just tried doing so, and now the errors are gone, but the items doesn't load at all.

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.