zenek1290 Posted February 22, 2020 Share Posted February 22, 2020 Hi Guys, I recently started making minecraft mods and came up to my first problem that I cannot resolve... Problem is with loading texture of an item to the game. Here is my code and file tree. File Tree . ├── main │ ├── java │ │ └── com │ │ └── zenek1290 │ │ ├── Dungeons.java │ │ └── ModEventSubscriber.java │ └── resources │ ├── META-INF │ │ └── mods.toml │ ├── assets │ │ └── dungeons │ │ └── models │ │ └── item │ │ └── example_item.json │ ├── assets.dungeons.textures.items │ │ └── example_item.png │ └── pack.mcmeta └── test ├── java └── resources ModEventSubscriber.java package com.zenek1290; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.IForgeRegistryEntry; @Mod.EventBusSubscriber(modid = Dungeons.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public final class ModEventSubscriber { @SubscribeEvent public static void onRegisterItem(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll( setup(new Item(new Item.Properties()), "example_item") ); } public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final String name) { return setup(entry, new ResourceLocation(Dungeons.MODID, name)); } public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final ResourceLocation registryName) { entry.setRegistryName(registryName); return entry; } } example_item.json { "parent": "item/generated", "textures": { "layer0": "dungeons:items/example_item" } } Quote Link to comment Share on other sites More sharing options...
Ugdhar Posted February 22, 2020 Share Posted February 22, 2020 I believe it should be textures.item package, no s at the end. Quote Link to comment Share on other sites More sharing options...
zenek1290 Posted February 22, 2020 Author Share Posted February 22, 2020 53 minutes ago, Ugdhar said: I believe it should be textures.item package, no s at the end. I tried it, but sadly it's not a solution. Quote Link to comment Share on other sites More sharing options...
Draco18s Posted February 22, 2020 Share Posted February 22, 2020 4 hours ago, zenek1290 said: │ ├── assets │ │ └── dungeons │ │ └── models │ │ └── item │ │ └── example_item.json │ ├── assets.dungeons.textures.items │ │ └── example_item.png Just to verify, when you put "assets.dungeons.textures.items" here, that's still a nested folder structure like the models, above, yes? Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
zenek1290 Posted February 22, 2020 Author Share Posted February 22, 2020 Yes, this is nested folder Quote Link to comment Share on other sites More sharing options...
zenek1290 Posted February 22, 2020 Author Share Posted February 22, 2020 1 hour ago, zenek1290 said: Yes, this is nested folder I was wrong, it was different folder, my error is gone. Thanks for Your support. Quote Link to comment Share on other sites More sharing options...
zenek1290 Posted February 22, 2020 Author Share Posted February 22, 2020 │ ├── assets │ │ └── dungeons │ │ ├── models │ │ │ └── item │ │ │ └── example_item.json │ │ └── textures │ │ └── item │ │ └── example_item.png Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.