Résolu [SEMI TUTO] Création de mon mob hostile: spawn, attaque etc.
-
Je sais que sur tropicraft (ou tropico), un dinosaure d’au moins 6-7 mètres de long pour 15-16 de haut a une boîte de collision presque inatteignable (une petite partie d’une patte). Mais je sais qu’il y a un truc de bounding box pour les entités, faut que je voies comment s’en servir.
-
Je reposte car j’ai deux nouveaux problèmes (le premier: on peut pas remplacer EntityPlayer par EntityLiving pour l’attaque des mobs, sinon ils n’attaquent pas… Je ne comprends pas).
Deuxièmement: J’ai inséré un nouveau mob (Brachycératops). L’ennui c’est qu’il prend la texture, le model et même les points de vie du gorgosaurus. Du coup il est remplacé par Gorgosaurus. (étrangement il a gardé ses points de vie et son son que je lui avais mis cependant…). J’ai cherché pendant une bonne heure l’erreur, pas trouvé! A vous de jouer :/. (sinon c’est normal qu’une entity Ambiant pop à l’infini dans un monde?)
package fr.modzoic.mod; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; 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.GameRegistry; import fr.modzoic.mod.items.Dinomeat; import fr.modzoic.mod.items.MeatEpanterias; import fr.modzoic.mod.proxy.CommonProxy; import fr.modzoic.mod.registry.EntitiesRegistry; import fr.modzoic.mod.util.References; @Mod(modid = References.MODID, name = References.MODNAME, version = References.MODVERSION) public class Modzoic { @Instance("modzoic") public static Modzoic instance; @SidedProxy(clientSide = "fr.modzoic.mod.proxy.ClientProxy", serverSide = "fr.modzoic.mod.proxy.CommonProxy") public static CommonProxy proxy; public static Item meatEpanterias; @EventHandler public void preInit(FMLPreInitializationEvent event) { meatEpanterias = new MeatEpanterias(10, 0.5F, true).setCreativeTab(CreativeTabs.tabFood); GameRegistry.registerItem(meatEpanterias, "meatEpanterias"); //Tu peux aussi mettre ça dans l'init Dinomeat.init(); Dinomeat.register(); //Tu peux aussi mettre ça dans l'init //Je précise que tu as deux façons de register tes items, c'est mieux d'en prendre q'une... } @EventHandler public void init(FMLInitializationEvent event) { EntitiesRegistry.registerEntities(instance); proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
package fr.modzoic.mod.entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import fr.modzoic.mod.Modzoic; public class EntityBrachyceratops extends EntityMob { public EntityBrachyceratops(World world) { super(world); this.setSize(1, 1); ((PathNavigateGround)this.getNavigator()).setBreakDoors(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, false)); } @Override public void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(31D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.5D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(30D); } @Override public void dropFewItems(boolean b, int looting) { this.dropItem(Modzoic.meatEpanterias, 4); } @Override public void onUpdate() { super.onUpdate(); } @Override protected String getLivingSound() { return "modzoic" + ":mob.brachyceratops.living"; } @Override public boolean canDespawn() { return false; } @Override public boolean getCanSpawnHere() { int i = MathHelper.floor_double(posX); int j = MathHelper.floor_double(this.getEntityBoundingBox().minY); int k = MathHelper.floor_double(posZ); int l = worldObj.getLight(new BlockPos(i, j, k)); return worldObj.getCollidingBoundingBoxes(this, getEntityBoundingBox()).size() == 0 && worldObj.checkNoEntityCollision(this.getEntityBoundingBox()) && worldObj.canSeeSky(new BlockPos(i, j, k)) && rand.nextInt(5) == 0 && l > 10; } }
package fr.modzoic.mod.proxy; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraftforge.fml.client.registry.RenderingRegistry; import fr.modzoic.mod.Modzoic; import fr.modzoic.mod.entity.EntityBrachyceratops; import fr.modzoic.mod.entity.EntityGorgosaurus; import fr.modzoic.mod.entity.EntityNanuqsaurus; import fr.modzoic.mod.items.Dinomeat; import fr.modzoic.mod.render.RenderBrachy; import fr.modzoic.mod.render.RenderGorgo; import fr.modzoic.mod.render.RenderNanuqsaurus; import fr.modzoic.mod.render.model.ModelBrachy; import fr.modzoic.mod.render.model.ModelGorgo; import fr.modzoic.mod.render.model.ModelNanuqsaurus; public class ClientProxy extends CommonProxy { @Override public void registerRender() { RenderItem registerMesher = Minecraft.getMinecraft().getRenderItem(); registerMesher.getItemModelMesher().register(Modzoic.meatEpanterias, 0, new ModelResourceLocation("modzoic" + ":meatEpanterias", "inventory")); Dinomeat.registerRender(); RenderingRegistry.registerEntityRenderingHandler(EntityNanuqsaurus.class, new RenderNanuqsaurus(Minecraft.getMinecraft().getRenderManager(), new ModelNanuqsaurus(), 2F)); RenderingRegistry.registerEntityRenderingHandler(EntityGorgosaurus.class, new RenderGorgo(Minecraft.getMinecraft().getRenderManager(), new ModelGorgo(), 2F)); RenderingRegistry.registerEntityRenderingHandler(EntityBrachyceratops.class, new RenderBrachy(Minecraft.getMinecraft().getRenderManager(), new ModelBrachy(), 1F)); } }
package fr.modzoic.mod.registry; import java.util.Random; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.fml.common.registry.EntityRegistry; import fr.modzoic.mod.entity.EntityNanuqsaurus; import fr.modzoic.mod.entity.EntityBrachyceratops; import fr.modzoic.mod.entity.EntityGorgosaurus; public class EntitiesRegistry { public static void registerEntities(Object modInstance) { Class entityClass = EntityNanuqsaurus.class; String name = "Nanuqsaurus"; Random random = new Random(name.hashCode()); int mainColor = random.nextInt() * 16777215; int subColor = random.nextInt() * 16777215; EntityRegistry.registerModEntity(entityClass, name, 0, modInstance, 64, 1, true, mainColor, subColor); EntityRegistry.addSpawn(entityClass, 5, 1, 3, EnumCreatureType.CREATURE, BiomeGenBase.forest, BiomeGenBase.beach, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills ,BiomeGenBase.coldBeach ,BiomeGenBase.coldTaiga ,BiomeGenBase.coldTaigaHills ,BiomeGenBase.desert ,BiomeGenBase.desertHills ,BiomeGenBase.extremeHills ,BiomeGenBase.forestHills ,BiomeGenBase.frozenRiver ,BiomeGenBase.iceMountains ,BiomeGenBase.icePlains ,BiomeGenBase.jungle ,BiomeGenBase.jungleEdge ,BiomeGenBase.jungleHills ,BiomeGenBase.megaTaiga ,BiomeGenBase.megaTaigaHills ,BiomeGenBase.mesa ,BiomeGenBase.mesaPlateau ,BiomeGenBase.mesaPlateau_F ,BiomeGenBase.plains ,BiomeGenBase.roofedForest ,BiomeGenBase.savanna ,BiomeGenBase.savannaPlateau ,BiomeGenBase.taigaHills ,BiomeGenBase.taiga ,BiomeGenBase.stoneBeach); entityClass = EntityGorgosaurus.class; name = "Gorgosaurus"; random = new Random(name.hashCode()); mainColor = random.nextInt() * 16777215; subColor = random.nextInt() * 16777215; EntityRegistry.registerModEntity(entityClass, name, 1, modInstance, 64, 1, true, mainColor, subColor); EntityRegistry.addSpawn(entityClass, 2, 1, 2, EnumCreatureType.CREATURE, BiomeGenBase.forest, BiomeGenBase.beach, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills ,BiomeGenBase.coldBeach ,BiomeGenBase.coldTaiga ,BiomeGenBase.coldTaigaHills ,BiomeGenBase.desert ,BiomeGenBase.desertHills ,BiomeGenBase.extremeHills ,BiomeGenBase.forestHills ,BiomeGenBase.frozenRiver ,BiomeGenBase.iceMountains ,BiomeGenBase.icePlains ,BiomeGenBase.jungle ,BiomeGenBase.jungleEdge ,BiomeGenBase.jungleHills ,BiomeGenBase.megaTaiga ,BiomeGenBase.megaTaigaHills ,BiomeGenBase.mesa ,BiomeGenBase.mesaPlateau ,BiomeGenBase.mesaPlateau_F ,BiomeGenBase.plains ,BiomeGenBase.roofedForest ,BiomeGenBase.savanna ,BiomeGenBase.savannaPlateau ,BiomeGenBase.taigaHills ,BiomeGenBase.taiga ,BiomeGenBase.stoneBeach); entityClass = EntityBrachyceratops.class; name = "Brachyceratops"; random = new Random(name.hashCode()); mainColor = random.nextInt() * 16777215; subColor = random.nextInt() * 16777215; EntityRegistry.registerModEntity(entityClass, name, 1, modInstance, 64, 1, true, mainColor, subColor); EntityRegistry.addSpawn(entityClass, 5, 1, 10, EnumCreatureType.CREATURE, BiomeGenBase.forest, BiomeGenBase.beach, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills ,BiomeGenBase.coldBeach ,BiomeGenBase.coldTaiga ,BiomeGenBase.coldTaigaHills ,BiomeGenBase.desert ,BiomeGenBase.desertHills ,BiomeGenBase.extremeHills ,BiomeGenBase.forestHills ,BiomeGenBase.frozenRiver ,BiomeGenBase.iceMountains ,BiomeGenBase.icePlains ,BiomeGenBase.jungle ,BiomeGenBase.jungleEdge ,BiomeGenBase.jungleHills ,BiomeGenBase.megaTaiga ,BiomeGenBase.megaTaigaHills ,BiomeGenBase.mesa ,BiomeGenBase.mesaPlateau ,BiomeGenBase.mesaPlateau_F ,BiomeGenBase.plains ,BiomeGenBase.roofedForest ,BiomeGenBase.savanna ,BiomeGenBase.savannaPlateau ,BiomeGenBase.taigaHills ,BiomeGenBase.taiga ,BiomeGenBase.stoneBeach); } }
package fr.modzoic.mod.render; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; public class RenderBrachy extends RenderLiving { private static final ResourceLocation texture = new ResourceLocation("modzoic" + ":textures/mobs/Bracycheratops.png"); public RenderBrachy(RenderManager render, ModelBase model, float x) { super(render, model, x); } @Override protected ResourceLocation getEntityTexture(Entity entity) { return texture; } }
package fr.modzoic.mod.render.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelBrachy extends ModelBase { ModelRenderer Corps_central; ModelRenderer Avant_patte_1_droite; ModelRenderer Avant_patte_1_gauche; ModelRenderer Arriere_patte_1_droite; ModelRenderer Arriere_patte_1_gauche; ModelRenderer Arriere_patte_2_gauche; ModelRenderer Avant_patte_2_gauche; ModelRenderer Arriere_patte_2_droite; ModelRenderer Avant_patte_2_droite; ModelRenderer Avant_patte_3_gauche; ModelRenderer Avant_patte_4_gauche; ModelRenderer Arriere_patte_3_gauche; ModelRenderer Arriere_patte_3_droite; ModelRenderer Avant_patte_3_droite; ModelRenderer Arriere_patte_4_gauche; ModelRenderer Arriere_patte_4_droite; ModelRenderer Avant_patte_4_droite; ModelRenderer Queue_1; ModelRenderer Queue_2; ModelRenderer Queue_3; ModelRenderer Queue_4; ModelRenderer Cou; ModelRenderer Colerette; ModelRenderer Crane; ModelRenderer Mandibule_haute; ModelRenderer Mandibule_basse; ModelRenderer Corne; ModelRenderer Sourcils_gauches; ModelRenderer Sourcils_droits; public ModelBrachy() { textureWidth = 128; textureHeight = 64; Corps_central = new ModelRenderer(this, 88, 17); Corps_central.addBox(-3F, -3F, 0F, 7, 6, 10); Corps_central.setRotationPoint(-3F, 14F, -4F); Corps_central.setTextureSize(128, 64); Corps_central.mirror = true; setRotation(Corps_central, 0F, 0F, 0F); Avant_patte_1_droite = new ModelRenderer(this, 98, 34); Avant_patte_1_droite.addBox(-1F, 0F, -1F, 2, 4, 3); Avant_patte_1_droite.setRotationPoint(-6F, 14.3F, -0.5F); Avant_patte_1_droite.setTextureSize(128, 64); Avant_patte_1_droite.mirror = true; setRotation(Avant_patte_1_droite, -0.5061455F, 0F, 0F); Avant_patte_1_gauche = new ModelRenderer(this, 98, 34); Avant_patte_1_gauche.addBox(-1F, 0F, -1F, 2, 4, 3); Avant_patte_1_gauche.setRotationPoint(1F, 14.3F, -0.5F); Avant_patte_1_gauche.setTextureSize(128, 64); Avant_patte_1_gauche.mirror = true; setRotation(Avant_patte_1_gauche, -0.5061455F, 0F, 0F); Arriere_patte_1_droite = new ModelRenderer(this, 98, 34); Arriere_patte_1_droite.addBox(-1F, 0F, -1F, 2, 4, 3); Arriere_patte_1_droite.setRotationPoint(-6F, 14.3F, 5.5F); Arriere_patte_1_droite.setTextureSize(128, 64); Arriere_patte_1_droite.mirror = true; setRotation(Arriere_patte_1_droite, -0.5061455F, 0F, 0F); Arriere_patte_1_gauche = new ModelRenderer(this, 98, 34); Arriere_patte_1_gauche.addBox(-1F, 0F, -1F, 2, 4, 3); Arriere_patte_1_gauche.setRotationPoint(1F, 14.3F, 5.5F); Arriere_patte_1_gauche.setTextureSize(128, 64); Arriere_patte_1_gauche.mirror = true; setRotation(Arriere_patte_1_gauche, -0.5061455F, 0F, 0F); Arriere_patte_2_gauche = new ModelRenderer(this, 98, 41); Arriere_patte_2_gauche.addBox(-1F, 0F, -1F, 2, 4, 2); Arriere_patte_2_gauche.setRotationPoint(1F, 17F, 3.7F); Arriere_patte_2_gauche.setTextureSize(128, 64); Arriere_patte_2_gauche.mirror = true; setRotation(Arriere_patte_2_gauche, 0.2617994F, 0F, 0F); Avant_patte_2_gauche = new ModelRenderer(this, 98, 41); Avant_patte_2_gauche.addBox(-1F, 0F, -1F, 2, 4, 2); Avant_patte_2_gauche.setRotationPoint(1F, 17F, -2.3F); Avant_patte_2_gauche.setTextureSize(128, 64); Avant_patte_2_gauche.mirror = true; setRotation(Avant_patte_2_gauche, 0.2617994F, 0F, 0F); Arriere_patte_2_droite = new ModelRenderer(this, 98, 41); Arriere_patte_2_droite.addBox(-1F, 0F, -1F, 2, 4, 2); Arriere_patte_2_droite.setRotationPoint(-6F, 17F, 3.7F); Arriere_patte_2_droite.setTextureSize(128, 64); Arriere_patte_2_droite.mirror = true; setRotation(Arriere_patte_2_droite, 0.2617994F, 0F, 0F); Avant_patte_2_droite = new ModelRenderer(this, 98, 41); Avant_patte_2_droite.addBox(-1F, 0F, -1F, 2, 4, 2); Avant_patte_2_droite.setRotationPoint(-6F, 17F, -2.3F); Avant_patte_2_droite.setTextureSize(128, 64); Avant_patte_2_droite.mirror = true; setRotation(Avant_patte_2_droite, 0.2617994F, 0F, 0F); Avant_patte_3_gauche = new ModelRenderer(this, 98, 48); Avant_patte_3_gauche.addBox(-1F, 0F, -1F, 2, 3, 2); Avant_patte_3_gauche.setRotationPoint(1F, 20F, -1.2F); Avant_patte_3_gauche.setTextureSize(128, 64); Avant_patte_3_gauche.mirror = true; setRotation(Avant_patte_3_gauche, -0.3490659F, 0F, 0F); Avant_patte_4_gauche = new ModelRenderer(this, 98, 56); Avant_patte_4_gauche.addBox(-1F, 0F, -2F, 2, 2, 3); Avant_patte_4_gauche.setRotationPoint(1F, 22F, -2F); Avant_patte_4_gauche.setTextureSize(128, 64); Avant_patte_4_gauche.mirror = true; setRotation(Avant_patte_4_gauche, 0F, 0F, 0F); Arriere_patte_3_gauche = new ModelRenderer(this, 98, 48); Arriere_patte_3_gauche.addBox(-1F, 0F, -1F, 2, 3, 2); Arriere_patte_3_gauche.setRotationPoint(1F, 20F, 4.8F); Arriere_patte_3_gauche.setTextureSize(128, 64); Arriere_patte_3_gauche.mirror = true; setRotation(Arriere_patte_3_gauche, -0.3490659F, 0F, 0F); Arriere_patte_3_droite = new ModelRenderer(this, 98, 48); Arriere_patte_3_droite.addBox(-1F, 0F, -1F, 2, 3, 2); Arriere_patte_3_droite.setRotationPoint(-6F, 20F, 4.8F); Arriere_patte_3_droite.setTextureSize(128, 64); Arriere_patte_3_droite.mirror = true; setRotation(Arriere_patte_3_droite, -0.3490659F, 0F, 0F); Avant_patte_3_droite = new ModelRenderer(this, 98, 48); Avant_patte_3_droite.addBox(-1F, 0F, -1F, 2, 3, 2); Avant_patte_3_droite.setRotationPoint(-6F, 20F, -1.2F); Avant_patte_3_droite.setTextureSize(128, 64); Avant_patte_3_droite.mirror = true; setRotation(Avant_patte_3_droite, -0.3490659F, 0F, 0F); Arriere_patte_4_gauche = new ModelRenderer(this, 98, 56); Arriere_patte_4_gauche.addBox(-1F, 0F, -2F, 2, 2, 3); Arriere_patte_4_gauche.setRotationPoint(1F, 22F, 4F); Arriere_patte_4_gauche.setTextureSize(128, 64); Arriere_patte_4_gauche.mirror = true; setRotation(Arriere_patte_4_gauche, 0F, 0F, 0F); Arriere_patte_4_droite = new ModelRenderer(this, 98, 56); Arriere_patte_4_droite.addBox(-1F, 0F, -2F, 2, 2, 3); Arriere_patte_4_droite.setRotationPoint(-6F, 22F, 4F); Arriere_patte_4_droite.setTextureSize(128, 64); Arriere_patte_4_droite.mirror = true; setRotation(Arriere_patte_4_droite, 0F, 0F, 0F); Avant_patte_4_droite = new ModelRenderer(this, 98, 56); Avant_patte_4_droite.addBox(-1F, 0F, -2F, 2, 2, 3); Avant_patte_4_droite.setRotationPoint(-6F, 22F, -2F); Avant_patte_4_droite.setTextureSize(128, 64); Avant_patte_4_droite.mirror = true; setRotation(Avant_patte_4_droite, 0F, 0F, 0F); Queue_1 = new ModelRenderer(this, 38, 2); Queue_1.addBox(-3F, -2F, 0F, 6, 5, 4); Queue_1.setRotationPoint(-2.5F, 13.5F, 5.5F); Queue_1.setTextureSize(128, 64); Queue_1.mirror = true; setRotation(Queue_1, 0F, 0F, 0F); Queue_2 = new ModelRenderer(this, 59, 2); Queue_2.addBox(-2.5F, -2F, 0F, 5, 4, 4); Queue_2.setRotationPoint(-2.5F, 14F, 9F); Queue_2.setTextureSize(128, 64); Queue_2.mirror = true; setRotation(Queue_2, -0.0174533F, 0F, 0F); Queue_3 = new ModelRenderer(this, 78, 2); Queue_3.addBox(-2F, -1F, 0F, 4, 3, 3); Queue_3.setRotationPoint(-2.5F, 13.5F, 12.5F); Queue_3.setTextureSize(128, 64); Queue_3.mirror = true; setRotation(Queue_3, -0.0349066F, 0F, 0F); Queue_4 = new ModelRenderer(this, 93, 2); Queue_4.addBox(-1.5F, -1F, 0F, 3, 2, 3); Queue_4.setRotationPoint(-2.5F, 14F, 15F); Queue_4.setTextureSize(128, 64); Queue_4.mirror = true; setRotation(Queue_4, -0.0523599F, 0F, 0F); Cou = new ModelRenderer(this, 64, 18); Cou.addBox(-2.5F, -3F, -4F, 5, 5, 6); Cou.setRotationPoint(-3F, 14.5F, -5F); Cou.setTextureSize(128, 64); Cou.mirror = true; setRotation(Cou, -0.1047198F, 0F, 0F); Colerette = new ModelRenderer(this, 42, 17); Colerette.addBox(-5F, -4F, 0F, 9, 10, 1); Colerette.setRotationPoint(-2.4F, 11F, -6F); Colerette.setTextureSize(128, 64); Colerette.mirror = true; setRotation(Colerette, -0.6981317F, 0F, 0F); Crane = new ModelRenderer(this, 23, 18); Crane.addBox(0F, 0F, 0F, 5, 5, 4); Crane.setRotationPoint(-5.5F, 12.5F, -12.4F); Crane.setTextureSize(128, 64); Crane.mirror = true; setRotation(Crane, 0.3665191F, 0F, 0F); Mandibule_haute = new ModelRenderer(this, 10, 17); Mandibule_haute.addBox(0F, 0F, 0F, 4, 3, 1); Mandibule_haute.setRotationPoint(-5F, 13F, -13F); Mandibule_haute.setTextureSize(128, 64); Mandibule_haute.mirror = true; setRotation(Mandibule_haute, 0.3839724F, 0F, 0F); Mandibule_basse = new ModelRenderer(this, 10, 22); Mandibule_basse.addBox(0F, 0F, 0F, 4, 2, 1); Mandibule_basse.setRotationPoint(-5F, 15F, -12F); Mandibule_basse.setTextureSize(128, 64); Mandibule_basse.mirror = true; setRotation(Mandibule_basse, 0.2617994F, 0F, 0F); Corne = new ModelRenderer(this, 23, 13); Corne.addBox(-4F, 0F, -3F, 1, 1, 1); Corne.setRotationPoint(0.5F, 12.6F, -9F); Corne.setTextureSize(128, 64); Corne.mirror = true; setRotation(Corne, -0.4014257F, 0F, 0F); Sourcils_gauches = new ModelRenderer(this, 32, 12); Sourcils_gauches.addBox(4F, 0F, 0F, 0, 1, 1); Sourcils_gauches.setRotationPoint(-5F, 11.2F, -9F); Sourcils_gauches.setTextureSize(128, 64); Sourcils_gauches.mirror = true; setRotation(Sourcils_gauches, 0.7853982F, 0F, 0F); Sourcils_droits = new ModelRenderer(this, 32, 12); Sourcils_droits.addBox(0F, 0F, 0F, 0, 1, 1); Sourcils_droits.setRotationPoint(-5F, 11.2F, -9F); Sourcils_droits.setTextureSize(128, 64); Sourcils_droits.mirror = true; setRotation(Sourcils_droits, 0.7853982F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Corps_central.render(f5); Avant_patte_1_droite.render(f5); Avant_patte_1_gauche.render(f5); Arriere_patte_1_droite.render(f5); Arriere_patte_1_gauche.render(f5); Arriere_patte_2_gauche.render(f5); Avant_patte_2_gauche.render(f5); Arriere_patte_2_droite.render(f5); Avant_patte_2_droite.render(f5); Avant_patte_3_gauche.render(f5); Avant_patte_4_gauche.render(f5); Arriere_patte_3_gauche.render(f5); Arriere_patte_3_droite.render(f5); Avant_patte_3_droite.render(f5); Arriere_patte_4_gauche.render(f5); Arriere_patte_4_droite.render(f5); Avant_patte_4_droite.render(f5); Queue_1.render(f5); Queue_2.render(f5); Queue_3.render(f5); Queue_4.render(f5); Cou.render(f5); Colerette.render(f5); Crane.render(f5); Mandibule_haute.render(f5); Mandibule_basse.render(f5); Corne.render(f5); Sourcils_gauches.render(f5); Sourcils_droits.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } }
-
Tu leur as mis le même ID donc mc confond (c’est le 1 après entityClass sur la ligne de registry
Envoyé de mon RAINBOW LITE 4G en utilisant Tapatalk
-
Merci beaucoup! C’était ça :).
Quand je vais en paisible les mobs disparaissent. Comment faire pour que cela n’arrive pas, quitte à désactiver leur attaque?
De plus, j’aimerai modifier le comportement de Brachycératops, faire en sorte qu’il se comporte comme les loups: neutre sauf si on l’attaque. Merci d’avance :D! -
Le problème c’est que ton entité est extends EntityMob, or si ton entité est un mob, elle va despawn lorsque tu passes en peaceful, le seul moyen est de changer l’extends
-
Dès que je change l’extends (en Animal ou Tameable par exemple), il ne peut plus apparaitre en jeu (même avec un oeuf)
-
Normal il faut adapter
-
Et quelles sont les modifications pour l’adapter? J’essaie de trouver mais j’y arrive pas x/.
-
Regarde les autres classes qui sont étendus de EntityAnimal
-
Je up ce sujet, qui, je trouve, est une vraie mine d’information ! (en tout cas moi il m’aide encore aujourd’hui xD)
Toutes les infos ou presque sont passées dedans, et c’est un véritable historique pour la création d’un mod qui aiderait plus d’un nouveau ^^.