Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DoorCloser

Members
  • Joined

  • Last visited

  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?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.