Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

DoorCloser

Members
  • Posts

    178
  • Joined

  • Last visited

Everything posted by DoorCloser

  1. Somebody? Can anybody help, please?
  2. 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?
  3. 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...
  4. How can i use all attack code i have in the task? Please help.
  5. 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.
  6. 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!
  7. 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));
  8. 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));
  9. I tried to put it all like that For an example, IronGolem have the same.
  10. 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.
  11. Well, ok. Do you have any ideas which class could contain Tick Handler, so i can figure out what is what?
  12. 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!
  13. 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)
  14. 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)
  15. WEll, i havent got that part of code you gave me here. Maybe you can help with my code?
  16. Well, i tried that out. Still dont work. protected void rotateHeadcrabCorpse(EntityHeadcrab par1EntityHeadcrab, float par2, float par3, float par4) { super.rotateCorpse(par1EntityHeadcrab, par2, par3, par4); if (par2 > 2.0F && par2 < 6.0F && this.rand.nextInt(10) == 0) { if (par1EntityHeadcrab.onGround = true) { GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F); } else { GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F); } } } COme on guys, i've already checked out alot of ways to do so. Could anybody help me please?
  17. Well, thats livingAnimations. I almost know what to do with that too. But i dont need only one part rotating, i want the whole body rotate.
  18. I tried to use those strings, but that didnt help. DO anybody have any suggestions?
  19. So, i've got this action, that my mob perform when attack( basicly when it jumps on me ): protected void attackEntity(Entity par1Entity, float par2) { float f1 = this.getBrightness(1.0F); if (f1 > 0.5F && this.rand.nextInt(100) == 0) { this.entityToAttack = null; } else { if (par2 > 2.0F && par2 < 6.0F && this.rand.nextInt(10) == 0) { if (this.onGround) { this.playSound("headcrab.hc_attack", 1.0F, 1.0F); 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 * 0.5D * 1.800000011920929D + this.motionX * 0.20000000298023224D; this.motionZ = d1 / (double)f2 * 0.5D * 0.800000011920929D + this.motionZ * 0.20000000298023224D; this.motionY = 0.5000000059604645D; } } else { super.attackEntity(par1Entity, par2); } } } For this action, i want my mob to do GL11.rotatef() itself. Basicly when my mob jumps, it performs rotation. How can i do that? I suppose, i have to put GL11.rotatef in Render but how? Can somebody help me with that? Thanks alot if you do, thats a very important thing for me. P.S> Would be better if you give a code as example
  20. Ok, thats almost what i wanted. Thanks alot mate)
  21. I just want my mob to LEAP or JUMP on me when it gets as NEAR as CODE says. OTHERWISE my MOB is just going to WALK! Here is the damn code. I've MADE my MOB to PERFORM JUMPING ACTIONS, but he DOESNT WALK. I TRIED to USE the moveSpeed METHOD, but that DIDNT WORKS. It only READS moveForward and moveStarfing. MAYBE thats because of AIDISABLED. I havent enabled it's AI because code WOULDNT WORK! WHAT I SUPPOSE TO DO. HOW CAN I MAKE MY MOB TO PERFORM JUMP ACTIONS WHEN HE GETS AS NEAR AS CODE SAYS, BUT OTHERWISE MOB WILL JUST WALK AFTER ME! CAN ANYBODY HELP!?
  22. I need to create a jumping mob. So, basicly his AI is too jump on target when it gets as near, as code says. Else mob is just walking. That would be great if somebody have any ideas.
  23. So, i've decided to make a new record disc for Minecraft. I watched some of tutorials, made this out. Main class file: public static final Item recordValve = (new HLItemRecord(1450, "valve")).setUnlocalizedName("record"); MyItemRecord File( i had to make that one, because of protection on ItemRecord file: So, i have my Disc, it spawns and everything seems ok, but my music in jukebox is not playing. Here public static final Item recordValve = (new HLItemRecord(1450, "valve")).setUnlocalizedName("record"); you see, that after item ID there is "valve" String. Its probably the name file of my song. So, i've put my song in [jars/resources/mod/streaming] and named it "valve". Still, no song for me. What else i have to do? Thats all, what i've added to my mod, anything else i have to do with it?
  24. Ok, so i've added those strings and overrided them and it works! Finally. Thanks alot, never forgot your help. I'll give ya a "Thank You" Code: @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { return this.iconArray[this.doorTypeForIcon]; } @SideOnly(Side.CLIENT) @Override public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { if (par5 != 1 && par5 != 0) { int i1 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4); int j1 = i1 & 3; boolean flag = (i1 & 4) != 0; boolean flag1 = false; boolean flag2 = (i1 & != 0; if (flag) { if (j1 == 0 && par5 == 2) { flag1 = !flag1; } else if (j1 == 1 && par5 == 5) { flag1 = !flag1; } else if (j1 == 2 && par5 == 3) { flag1 = !flag1; } else if (j1 == 3 && par5 == 4) { flag1 = !flag1; } } else { if (j1 == 0 && par5 == 5) { flag1 = !flag1; } else if (j1 == 1 && par5 == 3) { flag1 = !flag1; } else if (j1 == 2 && par5 == 4) { flag1 = !flag1; } else if (j1 == 3 && par5 == 2) { flag1 = !flag1; } if ((i1 & 16) != 0) { flag1 = !flag1; } } return this.iconArray[this.doorTypeForIcon + (flag1 ? doorIconNames.length : 0) + (flag2 ? 1 : 0)]; } else { return this.iconArray[this.doorTypeForIcon]; } } @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister par1IconRegister) { this.iconArray = new Icon[doorIconNames.length * 2]; for (int i = 0; i < doorIconNames.length; ++i) { this.iconArray[i] = par1IconRegister.registerIcon(doorIconNames[i]); this.iconArray[i + doorIconNames.length] = new IconFlipped(this.iconArray[i], true, false); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.