Jump to content

I do not understand why my texture dose not load in game


Denis12345

Recommended Posts

ModItems
 

package com.Denis.den.item;


	import com.Denis.den.den;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

	public class ModItems {
	    public static final DeferredRegister<Item> ITEMS =
	            DeferredRegister.create(ForgeRegistries.ITEMS, den.MOD_ID);

	    public static final RegistryObject<Item> RUBY = ITEMS.register("ruby",
	            () -> new Item(new Item.Properties().tab(CreativeModeTab.TAB_FOOD)));


	    
	    public static void register(IEventBus eventBus) {
	        ITEMS.register(eventBus);
	    }
	}

My .mod file
 

package com.Denis.den;


	import com.Denis.den.item.ModItems;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;


	// The value here should match an entry in the META-INF/mods.toml file
	@Mod(den.MOD_ID)
	public class den {
	    public static final String MOD_ID = "den";

	    // Very Important Comment
	    public den() {
	        IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();

	        ModItems.register(modEventBus);

	        modEventBus.addListener(this::commonSetup);

	        MinecraftForge.EVENT_BUS.register(this);
	    }

	    private void commonSetup(final FMLCommonSetupEvent event) {

	    }

	    // You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
	    @Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
	    public static class ClientModEvents {
	        @SubscribeEvent
	        public static void onClientSetup(FMLClientSetupEvent event) {

	        }
	    }
	}

en_us.json

{
     "item.den.Ruby": "Ruby"
}

Ruby.json
 

{
  "parent": "item/generated",
  "textures": {
    "layer0": "den:item/Ruby"
  }
}

The png name is
Ruby.png

Link to comment
Share on other sites

Uppercase characters are not allowed in resource locations or the file names they point to.

You will find an error in your run/logs/debug.log that tells you the same.

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

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.

Announcements



×
×
  • Create New...

Important Information

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