@‘robin4002’:
Ou as-tu placé les textures ?
En passant, utilise plutôt :
protected static final ResourceLocation minerTexture = new ResourceLocation("modmohumans2", "mob/mineur.png");
Merci, ça marche :D. Par contre je n’arrive pas à mettre plusieurs textures pour le même mob :(.
Si quelqu’un pouvait m’aider 
D’ailleurs j’ai fait quelques tests mais mes mobs ne m’attaquent pas, même en survival. Une solution :D?
EDIT :
La texture de mon chevalier est invisible, pouvez-vous m’aider ?
Mon code :
RenderKnight :
| |
| package fr.MrBlockTNT.MoHumans; |
| |
| import net.minecraft.client.model.ModelBase; |
| import net.minecraft.client.model.ModelBiped; |
| import net.minecraft.client.renderer.entity.RenderBiped; |
| import net.minecraft.entity.Entity; |
| import net.minecraft.entity.EntityLiving; |
| import net.minecraft.util.ResourceLocation; |
| |
| public class RenderKnight extends RenderBiped |
| { |
| protected static final ResourceLocation texture = new ResourceLocation("modmohumans2", "mob/knight1.png"); |
| |
| public RenderKnight(ModelBiped base, float tailleOmbre) |
| { |
| super(base, tailleOmbre); |
| } |
| |
| protected ResourceLocation getTextures(EntityAssassin miner) |
| { |
| return texture; |
| } |
| |
| protected ResourceLocation getEntityTexture(Entity par1Entity) |
| { |
| return this.getTextures((EntityAssassin)par1Entity); |
| } |
| |
| } |
| |
ClientProxy :
| |
| package MrBlockTNT.Proxy; |
| |
| import cpw.mods.fml.client.registry.RenderingRegistry; |
| import fr.MrBlockTNT.MoHumans.*; |
| import net.minecraft.client.model.ModelBiped; |
| import net.minecraft.client.renderer.entity.RenderBiped; |
| import net.minecraft.entity.Entity; |
| import net.minecraft.util.ResourceLocation; |
| import net.minecraftforge.client.MinecraftForgeClient; |
| |
| public class ClientProxy extends CommonProxy |
| { |
| |
| @Override |
| public void registerRender() |
| { |
| RenderingRegistry.registerEntityRenderingHandler(EntityMiner.class, new RenderMiner(new ModelBiped(), 0.5F)); |
| RenderingRegistry.registerEntityRenderingHandler(EntityAssassin.class, new RenderAssassin(new ModelBiped(), 0.5F)); |
| RenderingRegistry.registerEntityRenderingHandler(EntityKnight.class, new RenderKnight(new ModelBiped(), 0.5F)); |
| RenderingRegistry.registerEntityRenderingHandler(EntityWoodCuter.class, new RenderWoodCuter(new ModelBiped(), 0.5F)); |
| RenderingRegistry.registerEntityRenderingHandler(EntityHunter.class, new RenderHunter(new ModelBiped(), 0.5F)); |
| RenderingRegistry.registerEntityRenderingHandler(EntityBarbarian.class, new RenderBarbarian(new ModelBiped(), 0.5F)); |
| RenderingRegistry.registerEntityRenderingHandler(EntityPirate.class, new RenderPirate(new ModelBiped(), 0.5F)); |
| } |
| |
| } |
| |
ModMoHumans2 :
| |
| package fr.MrBlockTNT.MoHumans; |
| |
| import net.minecraft.entity.EnumCreatureType; |
| import MrBlockTNT.Proxy.CommonProxy; |
| import cpw.mods.fml.common.Mod; |
| import cpw.mods.fml.common.Mod.EventHandler; |
| import cpw.mods.fml.common.Mod.Instance; |
| import cpw.mods.fml.common.SidedProxy; |
| import cpw.mods.fml.common.event.FMLInitializationEvent; |
| import cpw.mods.fml.common.event.FMLPostInitializationEvent; |
| import cpw.mods.fml.common.event.FMLPreInitializationEvent; |
| import cpw.mods.fml.common.network.NetworkMod; |
| import cpw.mods.fml.common.registry.EntityRegistry; |
| import cpw.mods.fml.common.registry.LanguageRegistry; |
| |
| @Mod(modid = "ModMoHumans2", name = "Mo'Humans 2", version = "1.0.0") |
| @NetworkMod(clientSideRequired = true, serverSideRequired = false) |
| |
| public class ModMoHumans |
| { |
| |
| @SidedProxy(clientSide = "MrBlockTNT.Proxy.ClientProxy", serverSide = "MrBlockTNT.Proxy.CommonProxy") |
| public static CommonProxy proxy; |
| |
| @Instance("ModMoHumans2") |
| public static ModMoHumans instance; |
| |
| @EventHandler |
| public void PreInit(FMLPreInitializationEvent event) |
| { |
| |
| } |
| |
| @EventHandler |
| public void Init(FMLInitializationEvent event) |
| { |
| |
| proxy.registerRender(); |
| |
| EntityRegistry.registerGlobalEntityID(EntityMiner.class, "Miner", EntityRegistry.findGlobalUniqueEntityId(), 0x6A7372, 0x78807F); |
| EntityRegistry.registerModEntity(EntityMiner.class, "Miner", 500, this, 40, 1, true); |
| EntityRegistry.addSpawn(EntityMiner.class, 1, 1, 2, EnumCreatureType.ambient); |
| LanguageRegistry.instance().addStringLocalization("entity.Miner.name", "Miner"); |
| |
| EntityRegistry.registerGlobalEntityID(EntityAssassin.class, "Assassin", EntityRegistry.findGlobalUniqueEntityId(), 0xF00000, 0x9E9292); |
| EntityRegistry.registerModEntity(EntityAssassin.class, "Assassin", 501, this, 40, 1, true); |
| EntityRegistry.addSpawn(EntityAssassin.class, 1, 1, 1, EnumCreatureType.monster); |
| LanguageRegistry.instance().addStringLocalization("entity.Assassin.name", "Assassin"); |
| |
| EntityRegistry.registerGlobalEntityID(EntityKnight.class, "Knight", EntityRegistry.findGlobalUniqueEntityId(), 0x131514, 0xC6DCD9); |
| EntityRegistry.registerModEntity(EntityKnight.class, "Knight", 502, this, 40, 1, true); |
| EntityRegistry.addSpawn(EntityKnight.class, 1, 3, 1, EnumCreatureType.ambient); |
| LanguageRegistry.instance().addStringLocalization("entity.Knight.name", "Knight"); |
| |
| EntityRegistry.registerGlobalEntityID(EntityWoodCuter.class, "WoodCuter", EntityRegistry.findGlobalUniqueEntityId(), 0x261801, 0x674306); |
| EntityRegistry.registerModEntity(EntityWoodCuter.class, "WoodCuter", 503, this, 40, 1, true); |
| EntityRegistry.addSpawn(EntityWoodCuter.class, 1, 1, 1, EnumCreatureType.ambient); |
| LanguageRegistry.instance().addStringLocalization("entity.WoodCuter.name", "Woodcuter"); |
| |
| EntityRegistry.registerGlobalEntityID(EntityHunter.class, "Hunter", EntityRegistry.findGlobalUniqueEntityId(), 0x261811, 0xC7C3BC); |
| EntityRegistry.registerModEntity(EntityHunter.class, "Hunter", 504, this, 40, 1, true); |
| EntityRegistry.addSpawn(EntityHunter.class, 1, 1, 1, EnumCreatureType.ambient); |
| LanguageRegistry.instance().addStringLocalization("entity.Hunter.name", "Hunter"); |
| |
| EntityRegistry.registerGlobalEntityID(EntityBarbarian.class, "Barbarian", EntityRegistry.findGlobalUniqueEntityId(), 0x231300, 0x000000); |
| EntityRegistry.registerModEntity(EntityBarbarian.class, "Barbarian", 505, this, 40, 1, true); |
| EntityRegistry.addSpawn(EntityBarbarian.class, 1, 1, 1, EnumCreatureType.monster); |
| LanguageRegistry.instance().addStringLocalization("entity.Barbarian.name", "Barbarian"); |
| |
| EntityRegistry.registerGlobalEntityID(EntityPirate.class, "Pirate", EntityRegistry.findGlobalUniqueEntityId(), 0x0F19AF, 0xDB0000); |
| EntityRegistry.registerModEntity(EntityPirate.class, "Pirate", 506, this, 40, 1, true); |
| EntityRegistry.addSpawn(EntityPirate.class, 1, 1, 1, EnumCreatureType.monster); |
| LanguageRegistry.instance().addStringLocalization("entity.Pirate.name", "Pirate"); |
| |
| } |
| |
| @EventHandler |
| public void PostInit(FMLPostInitializationEvent event) |
| { |
| |
| } |
| |
| } |
| |
EDIT 2 :
En fait j’ai trouvé mon erreur, qui était due à un oubli de modification après copié/collé x) .