
DoorCloser
Members-
Content Count
178 -
Joined
-
Last visited
Community Reputation
-1 PoorAbout DoorCloser
-
Rank
Creeper Killer
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
-
DoorCloser started following [SOLVED] [1.5.2.] Custom Mobs /w Custom Sounds.
-
Somebody? Can anybody help, please?
-
Problems: 1.For one of my mobs, i'm not using any AITasks, all AI is inside of the actual mob. So his AI is Disabled. It works perfect in eclipse though, but when i reobfustate, recompile and stuff, and putting my mod into the actual minecraft, this mob's AI doesnt work. When i put AI is Enabled, mob's ai stop working too. 2.I think i need to use tasks, but i dont know how to transfer all AI i've got into the task. Could somebody help me with something?
-
Well, this AI doesnt even take my variables. It used to be an Entity, not EntityAIMyai. I dont really know how can i wrap up the code and left it the same...
-
How can i use all attack code i have in the task? Please help.
-
Lets go to forward the main. Here is the code of my mob: So, there is actually his AI too. But when i put this: protected boolean isAIEnabled()// enable/disable ai { return true; } All of the code stop working. So mob doesnt attack as it was before i put isAIEnabled = true. How can i fix this? Really need your help.
-
Well, i finally understand. Here is the code. protected void attackEntity(Entity par1Entity, float par2) { if (par2 > 2.0F && par2 < 6.0F && this.rand.nextInt(10) == 0) { if (this.onGround) { this.attackTimer++; if(this.attackTimer > 3) { double d0 = par1Entity.posX - this.posX; double d1 = par1Entity.posZ - this.posZ; float f2 = MathHelper.sqrt_double(d0 * d0 + d1 * d1); this.motionX = d0 / (double)f2 * 1.2D * 0.800000011920929D + this.motionX * 0.20000000298023224D; this.motionZ = d1 / (double)f2 * 1.2D * 0.800000011920929D + this.motionZ * 0.20000000298023224D; this.motionY = 0.5600000059604645D; this.attackTimer = 0; this.playSound("headcrab.hc_attack", 1.0F, 1.0F); } } } else { super.attackEntity(par1Entity, par2); } } So, finally with if(attackTimer > 10) i can create the delay between attacks. THANKS ALOT MATES! THAT WAS VERY USEFUL!
-
Try those tasks. Put them in your mob class this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 0.25F, true)); this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
-
Try to use that tags in your mob class: this.tasks.addTask(1, new EntityAIFollowCalled(this, this.moveSpeed, 5.0F, 2.0F)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this,EntityPlayer.class, 25.0F, 0, true));
-
I tried to put it all like that For an example, IronGolem have the same.
-
Are there any mods that use similar potion effect? IF so, download them and decompile the code. I use JAD. But that code will contain a vanilla language, so you might missunderstand something.
-
Well, ok. Do you have any ideas which class could contain Tick Handler, so i can figure out what is what?
-
How can i make delays between the attack of Mob. I tried to look at some mobs, like: IronGolem, Creeper. I tried out their part of codes and that didnt work. So after the first attack, mob have to wait like 2 secs before next attack. How can i do so? Here is the code. Really need this guys, help!
-
protected void rotateHeadcrabCorpse(EntityHeadcrab par1EntityHeadcrab, float par2, float par3, float par4) { super.rotateCorpse(par1EntityHeadcrab, par2, par3, par4); if (!par1EntityHeadcrab.onGround) { float f3 = 13.0F; float f4 = par1EntityHeadcrab.limbSwing - par1EntityHeadcrab.limbYaw * (1.0F - par4) + 6.0F; float f5 = (Math.abs(f3 - f3 * 0.5F) - f3 * 0.25F) / (f3 * 0.25F); GL11.glRotatef(75.5F * f5, 1.0F, 0.0F, 0.0F); } } I used that and it works. Thanks anyways)
-
Well, i tried to use this code: protected void rotateHeadcrabCorpse(EntityHeadcrab par1EntityHeadcrab, float par2, float par3, float par4) { super.rotateCorpse(par1EntityHeadcrab, par2, par3, par4); if (!par1EntityHeadcrab.onGround) { float f3 = 13.0F; float f4 = par1EntityHeadcrab.limbSwing - par1EntityHeadcrab.limbYaw * (1.0F - par4) + 6.0F; float f5 = (Math.abs(f3 - f3 * 0.5F) - f3 * 0.25F) / (f3 * 0.25F); GL11.glRotatef(75.5F * f5, 1.0F, 0.0F, 0.0F); } } And everything almost works. Thanks)
-
WEll, i havent got that part of code you gave me here. Maybe you can help with my code?