Bonjour, après avoir suivi ton tuto qui m’a été très utile, je crée alors mon entité. Seul problème : Quand je veux faire spawner mon entité avec un oeuf voilà ce que ça me dis :
2013-10-03 15:33:44 [INFO] [STDOUT] Setting up custom skins
2013-10-03 15:33:49 [INFO] [STDERR] java.lang.reflect.InvocationTargetException
2013-10-03 15:33:49 [INFO] [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2013-10-03 15:33:49 [INFO] [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
2013-10-03 15:33:49 [INFO] [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
2013-10-03 15:33:49 [INFO] [STDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.entity.EntityList.createEntityByID(EntityList.java:205)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.item.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:175)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.item.ItemMonsterPlacer.onItemUse(ItemMonsterPlacer.java:81)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:152)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:429)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:554)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:689)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-10-03 15:33:49 [INFO] [STDERR] Caused by: java.lang.NullPointerException
2013-10-03 15:33:49 [INFO] [STDERR] at fr.MrBlockTNT.MoHumans.EntityMiner.applyEntityAttributes(EntityMiner.java:25)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:193)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:85)
2013-10-03 15:33:49 [INFO] [STDERR] at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:40)
2013-10-03 15:33:49 [INFO] [STDERR] at fr.MrBlockTNT.MoHumans.EntityMiner.<init>(EntityMiner.java:13)
2013-10-03 15:33:49 [INFO] [STDERR] … 20 more
2013-10-03 15:33:49 [WARNING] [Minecraft-Server] Skipping Entity with id 3
2013-10-03 15:33:50 [INFO] [Minecraft-Server] Saving and pausing game…
2013-10-03 15:33:50 [INFO] [Minecraft-Server] Saving chunks for level 'test'/Overworld
2013-10-03 15:33:50 [INFO] [Minecraft-Server] Saving chunks for level 'test'/Nether
2013-10-03 15:33:50 [INFO] [Minecraft-Server] Saving chunks for level 'test'/The End
Mon code :
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");
}
@EventHandler
public void PostInit(FMLPostInitializationEvent event)
{
}
}
ClientProxy :
package MrBlockTNT.Proxy;
import cpw.mods.fml.client.registry.RenderingRegistry;
import fr.MrBlockTNT.MoHumans.EntityMiner;
import fr.MrBlockTNT.MoHumans.RenderMiner;
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));
}
}
EntityMiner :
package fr.MrBlockTNT.MoHumans;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.world.World;
public class EntityMiner extends EntityCreature
{
public EntityMiner(World par1World)
{
super(par1World);
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(40D);
this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.699999988079071D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(8.0D);
}
}
RenderMiner :
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 RenderMiner extends RenderBiped
{
protected static final ResourceLocation minerTexture = new ResourceLocation("ModMoHumans2:mob/Mineur.png");
public RenderMiner(ModelBiped base, float tailleOmbre)
{
super(base, tailleOmbre);
}
protected ResourceLocation getMinerTextures(EntityMiner miner)
{
return minerTexture;
}
protected ResourceLocation getEntityTexture(Entity par1Entity)
{
return this.getMinerTextures((EntityMiner)par1Entity);
}
}
Peut-on m’aider ? Merci.
PS : Désolé si le code prends la moitié de la page x) et le fait que le code soit désorganisé (les tabulations ont été enlevées quand j’ai posté le code x) )</init></init></init></init>