Jump to content

Recommended Posts

Posted (edited)

I made a new entity called SummonedZombie that inherits most of the normal zombie's code. Everything works except for the missing texture on my SummonedZombie model in-game (shows as purple and black). I've checked the directory and file names many times, I don't see anything wrong with them.

Could someone please tell me what I'm doing wrong? Thanks.

 

Spoiler

package com.ScootMcShoot.scootsnecromancymod.init;

import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.EntityEntryBuilder;
import net.minecraftforge.registries.IForgeRegistry;

import java.util.Set;

import com.ScootMcShoot.scootsnecromancymod.common.entity.EntitySummonedZombie;
import com.google.common.collect.ImmutableSet;

public class ModEntities 
{
	  public static final Set<EntityEntry> SET_ENTITIES = ImmutableSet.of(
			EntityEntryBuilder.create()
		    .entity(EntitySummonedZombie.class)
		    .id(new ResourceLocation("scootsnm", "summoned_zombie"), 0)
		    .name("summoned_zombie")
		    .tracker(64, 1, false)
		    .build()
		    );


@EventBusSubscriber(modid = "scootsnm")
public static class RegistrationHandler
{
    /**
     * Register this mod's {@link EntityEntry}s.
     *
     * @param event The event
     */
    @SubscribeEvent
    public static void onEvent(final RegistryEvent.Register<EntityEntry> event)
    {
        final IForgeRegistry<EntityEntry> registry = event.getRegistry();

        // DEBUG
        System.out.println("Registering entities");

        for (final EntityEntry entityEntry : SET_ENTITIES)
        {
          // DEBUG
        	System.out.println("Registering entity = " + entityEntry.getEntityClass());

            registry.register(entityEntry);
        }
}
}
}

 

Spoiler

package com.ScootMcShoot.scootsnecromancymod.client.renderers;

import com.ScootMcShoot.scootsnecromancymod.common.entity.EntitySummonedZombie;

import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.client.registry.RenderingRegistry;

public class RenderFactories
{
    public static void registerEntityRenderers()
    {
        RenderingRegistry.registerEntityRenderingHandler(EntitySummonedZombie.class, RenderFactoryEntitySummonedZombie.INSTANCE);
    }

    public static class RenderFactoryEntitySummonedZombie implements IRenderFactory<EntitySummonedZombie>
    {
        public final static RenderFactoryEntitySummonedZombie INSTANCE = new RenderFactoryEntitySummonedZombie();
        
        public Render<EntitySummonedZombie> createRenderFor(RenderManager manager)
        {
            return new RenderSummonedZombie(manager);
        }
    }
}

 

Spoiler

package com.ScootMcShoot.scootsnecromancymod.client.renderers;

import com.ScootMcShoot.scootsnecromancymod.common.entity.EntitySummonedZombie;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelZombie;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderZombie;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class RenderSummonedZombie extends RenderLiving<EntitySummonedZombie>
{
    private static final ResourceLocation SUMMONED_ZOMBIE_TEXTURES = new ResourceLocation("scootsnm", "textures/entities/summmoned_zombie/summoned_zombie.png");

	public RenderSummonedZombie(RenderManager renderManagerIn) {
		super(renderManagerIn, new ModelZombie(), 1.0F);
		
	}

	@Override
	protected ResourceLocation getEntityTexture(EntitySummonedZombie entity) {
		return SUMMONED_ZOMBIE_TEXTURES;
	}

}

 

Spoiler

package com.ScootMcShoot.scootsnecromancymod.proxy;




import com.ScootMcShoot.scootsnecromancymod.client.renderers.RenderFactories;
import com.ScootMcShoot.scootsnecromancymod.client.renderers.RenderSummonedZombie;
import com.ScootMcShoot.scootsnecromancymod.common.entity.EntitySummonedZombie;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.registries.IForgeRegistryEntry;

public class ClientProxy implements IProxy
{
	public void registerItemRenderer(Item item, int meta, String id) 
	{
		ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id));
	}

	@Override
	public void preInit(FMLPreInitializationEvent event) {
        RenderFactories.registerEntityRenderers();
	}

	@Override
	public void init(FMLInitializationEvent event) {
       
	}

	@Override
	public void postInit(FMLPostInitializationEvent event) {
		
	}
}

 

 

Edited by ScootMcShoot
Posted

Post your log

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)

Posted
Spoiler

[13:58:05] [main/WARN] [net.minecraft.client.renderer.texture.TextureManager]: Failed to load texture: scootsnm:textures/entities/summmoned_zombie/summoned_zombie.png
java.io.FileNotFoundException: scootsnm:textures/entities/summmoned_zombie/summoned_zombie.png
    at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:69) ~[FallbackResourceManager.class:?]
    at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:65) ~[SimpleReloadableResourceManager.class:?]
    at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:34) ~[SimpleTexture.class:?]
    at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:69) [TextureManager.class:?]
    at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:44) [TextureManager.class:?]
    at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:130) [Render.class:?]
    at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:123) [Render.class:?]
    at net.minecraft.client.renderer.entity.RenderLivingBase.renderModel(RenderLivingBase.java:251) [RenderLivingBase.class:?]
    at net.minecraft.client.renderer.entity.RenderLivingBase.doRender(RenderLivingBase.java:183) [RenderLivingBase.class:?]
    at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:51) [RenderLiving.class:?]
    at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:16) [RenderLiving.class:?]
    at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:390) [RenderManager.class:?]
    at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:374) [RenderManager.class:?]
    at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:655) [RenderGlobal.class:?]
    at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1400) [EntityRenderer.class:?]
    at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1312) [EntityRenderer.class:?]
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1115) [EntityRenderer.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1208) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_212]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_212]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:25) [start/:?]

 

Posted

Here is the directory where the image is located, copy and pasted from my file explorer:

C:\Users\mccur\Desktop\Minecraft Modding\ScootsNecromancyMod\src\main\resources\assets\scootsnm\textures\entities\summoned_zombie

I don't see any issues with it.

 

I also attached a screenshot of the file in the directory. 

For the purposes of this post, I took the zombie.png from the 1.12.2.jar, renamed it summoned_zombie.png, and put it in the same directory to be absolutely sure that there was nothing wrong in the image format of my original file: this still returns a missing texture in-game.

exampleImage.png

Posted

Yes, the file is visible in Eclipse. I just added the full directory to the builder .id:

 

public static final Set<EntityEntry> SET_ENTITIES = ImmutableSet.of(
            EntityEntryBuilder.create()
            .entity(EntitySummonedZombie.class)
            .id(new ResourceLocation("scootsnm", ":textures/entities/summmoned_zombie/summoned_zombie.png"), 0)
            .name("summoned_zombie")
            .tracker(64, 1, false)
            .build()
            );

 

Same problem, although now I get this message whenever I load the world:

errorMessage.png

Posted
53 minutes ago, ScootMcShoot said:

id(new ResourceLocation("scootsnm", ":textures/entities/summmoned_zombie/summoned_zombie.png"), 0)

... this is not how you make a resource location. That is also not the place for the texture, that is for the registry name of the entity. 

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)

Posted

Ok, I changed it back. So I've been making my resource locations incorrectly? Is that why I've been getting missing textures? I've been following examples online, and I can't find anything wrong with them.

Posted
22 hours ago, Cadiboo said:

new ResourceLocation("scootsnm", ":textures/entities/summmoned_zombie/summoned_zombie.png")

Remove the “:”.

 

 

22 hours ago, Cadiboo said:

id(new ResourceLocation("scootsnm", ":textures/entities/summmoned_zombie/summoned_zombie.png"), 0)

 

22 hours ago, Cadiboo said:

This is also not the place for the texture, it’s for the registry name of the entity. 

Creepers aren’t called “minecraft::textures/entities/creeper.png”,they’re called “minecraft:creeper”

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)

Posted

Look very closely at the path in your renderer and the path on disk.

On 5/22/2019 at 12:10 AM, ScootMcShoot said:

new ResourceLocation("scootsnm", "textures/entities/summmoned_zombie/summoned_zombie.png");

 

On 5/22/2019 at 4:27 AM, ScootMcShoot said:

scootsnm\textures\entities\summoned_zombie

 

  • Thanks 1

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.