Résolu Problème mob
-
Bonjour je viens en vous en quête d’aide,j’ai un petit problème par rapport a un mob et je ne sais pas d’où ça vient
2013-11-30 12:48:08 [Avertissement] [Minecraft-Server] Skipping Entity with id 3 2013-11-30 12:48:08 [Infos] [STDERR] java.lang.reflect.InvocationTargetException 2013-11-30 12:48:08 [Infos] [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2013-11-30 12:48:08 [Infos] [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 2013-11-30 12:48:08 [Infos] [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 2013-11-30 12:48:08 [Infos] [STDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.entity.EntityList.createEntityByID(EntityList.java:205) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.item.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:175) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.item.ItemMonsterPlacer.onItemUse(ItemMonsterPlacer.java:81) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:153) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:434) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:556) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:691) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:587) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-11-30 12:48:08 [Infos] [STDERR] Caused by: java.lang.NullPointerException 2013-11-30 12:48:08 [Infos] [STDERR] at tutoriel.common.EntityAniZob.applyEntityAttributes(EntityAniZob.java:21) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:193) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:85) 2013-11-30 12:48:08 [Infos] [STDERR] at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:40) 2013-11-30 12:48:08 [Infos] [STDERR] at tutoriel.common.EntityAniZob.<init>(EntityAniZob.java:11) 2013-11-30 12:48:08 [Infos] [STDERR] … 20 more
Merci a ce qui m’aideront ;)</init></init></init></init>
-
Je pourrais avoir:
-version forge
-classe du mob
merci. -
Version forge 9.11.1.964
Classe
package opu.common; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.world.World; public class EntityAniZob extends EntityCreature { public EntityAniZob(World world) { super(world); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(40D); this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute (40.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.69); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(8.0D); } }
-
Retire cette ligne:
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(8.0D)?;
ton mob est extends Entitycreature donc il n’attaque pas. -
Tout fonctionne impec sauf la texture
package opu.proxy; import opu.common.EntityAniZob; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderBiped; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; public class RenderAnizob extends RenderBiped { protected static final ResourceLocation texture = new ResourceLocation("ModOPU:pirate.png"); public RenderAnizob(ModelBiped biped, float tailleOmbre) { super(biped, tailleOmbre); } protected ResourceLocation getAniZobTextures(EntityAniZob AniZob) { return texture; } protected ResourceLocation getEntityTexture(Entity par1Entity) { return this.getAniZobTextures((EntityAniZob)par1Entity); } }
Et le chemin de la texture assets/modopu/textures/pirate.png
-
protected static final ResourceLocation texture = new ResourceLocation(“modopu:textures/pirate.png”);
-
Merci marche impec