Jump to content

loawkise

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by loawkise

  1. I am trying to learn what is going on but it is a bit overwhelming at the moment. I will start again tomorrow so I can concentrate more. Thanks for the help anyways, you have been a massive help to me.
  2. Will your custom packet handling tutorial help?
  3. Ahhhh yes, that would make a lot of sense considering it tells me my player name as soon as I log in on the console (Player891 or whatever).
  4. Well I think it is just that in the setLivingAnimations() method, it isn't getting the updated value for int attackTimer, but I do not know why... It changes within the class attackTimer is created but not in the model class.
  5. Hrmm, I removed that, forgot I made it static, but now it isn't working at all. ENTITY public boolean attackEntityAsMob(Entity par1Entity) { this.attackTimer = 50; return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); } public void onLivingUpdate() { super.onLivingUpdate(); if (this.attackTimer > 0) { -- this.attackTimer; } } public int getAttackTimer() { return this.attackTimer; } MODEL public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { EntityGuardianStone entityguardianstone = (EntityGuardianStone)par1EntityLivingBase; int i = entityguardianstone.getAttackTimer(); if (i > 0) { this.JabbyThing.offsetZ = (float) (- i * 0.02); } else { this.JabbyThing.offsetZ = (float) 0.01; } }
  6. Ok another problem is that although it works, when I quit the game and relog, I cant make it unsit if you understand, so it doesnt follow me unless I spawn a new one and tame it again.
  7. 1 last major problem. When the animation occurs, it happens on every mob of that type.
  8. Yeah, I had a feeling I would have to do something like that. I have just been looking at the iron golem class as I want to do something similar to when it attacks and I think I get what I am doing now, thanks.
  9. That helped clear some stuff up, thanks. Any simple way of changing how long an animation will take, or will I just have to do some custom timer type things.
  10. Hi, I was wondering if anyone knew any good guides for animating my entity.
  11. Thanks, it works perfectly
  12. I added: this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); To applyEntityAttrivutes() but when it goes to attack something it just rubs against it Here is the ai code: public EntityBlockGuardianStone(World world) { super(world); this.setSize(0.85F, 0.91F); this.getNavigator().setAvoidsWater(true); this.getNavigator().setCanSwim(false); this.tasks.addTask(0, new EntityAIAttackOnCollide(this, 1.0D, true)); this.tasks.addTask(1, new EntityAIFollowOwner(this, 1.0D, 8.0F, 2.0F)); this.tasks.addTask(2, new EntityAIPanic(this, 1.5D)); this.targetTasks.addTask(0, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(1, new EntityAIOwnerHurtTarget(this)); this.targetTasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true)); this.setTamed(false); }
  13. I registered and set the damage like so but nothing changed: this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D);
  14. Thanks I will be having a look in a bit. I did set it before but it gave me an error
  15. I can't believe I forgot that, I had it commented out Now he will try to attack the mob but do no damage and just bump into it, so I will have a look at why that is.
  16. I used this method, which seems correct, but it doesn't seem to be doing anything. I am really new to modding so I apologize if I am being blind but I want to get into modding. public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) { if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) { if (par1EntityLivingBase instanceof EntityWolf) { EntityWolf entitywolf = (EntityWolf)par1EntityLivingBase; if (entitywolf.isTamed() && entitywolf.getOwner() == par2EntityLivingBase) { return false; } } return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).canAttackPlayer((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).isTame(); } else { return false; } }
  17. Never mind I still had setSitting(true) somewhere else so it didn't change. Now I am wondering if there are any methods that I need to make it attack like a wolf, so if something hurts the owner it will attack.
  18. I added this to the interact method but nothing seems to be working... if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack)) { this.aiSit.setSitting(!this.isSitting()); this.isJumping = false; this.setPathToEntity((PathEntity)null); this.setTarget((Entity)null); this.setAttackTarget((EntityLivingBase)null); }
  19. I had a feeling it was something like that as I saw it but I couldn't wrap my head round how it toggled. I will give it a shot now, thanks.
  20. How would I make my tameable mob stay in one place when it is right clicked. I have looked thorugh the wolf code and can't find much on when it is right clicked.
×
×
  • Create New...

Important Information

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