Posted June 24, 201510 yr Hi! This is like, the 10th post in this "Help with flying mobs" thing where I end up removing them. But I think I know what to ask this time! So, I was using some code from the horse class to make the mobs rideable and while messing around I found this line of code, where the strafe, forward, and friction values need to be modified: this.posY = ((EntityLivingBase)this.riddenByEntity).moveFlying(strafe, forward, friction); I assume that the strafe value should be p_70612_1_ and the forward value should be p_70612_2_, but I don't know what to put for friction. ***Side question that doesn't really need to be answered: Once the above question is answered, it would be awesome if I could get this info too- What else in my class do I need to change, if anything, to make the [this.posY=etc] line do something? here's the class: package com.darkflame.entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class RedCarMob extends EntityMob { public RedCarMob(World worldIn) { super(worldIn); } public boolean interact(EntityPlayer entityplayer) { if (riddenByEntity == null || riddenByEntity == entityplayer) { entityplayer.mountEntity(this); return true; } else { return false; } } public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) { if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; this.setRotation(this.rotationYaw, this.rotationPitch); this.rotationYawHead = this.renderYawOffset = this.rotationYaw; p_70612_1_ = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 0.5F; p_70612_2_ = ((EntityLivingBase)this.riddenByEntity).moveForward; if (p_70612_2_ <= 0.0F) { p_70612_2_ *= 0.25F; } this.stepHeight = 1.0F; this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; if (!this.worldObj.isRemote) { this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); super.moveEntityWithHeading(p_70612_1_, p_70612_2_); } this.prevLimbSwingAmount = this.limbSwingAmount; double d1 = this.posX - this.prevPosX; double d0 = this.posZ - this.prevPosZ; float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; if (f4 > 1.0F) { f4 = 1.0F; } this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; this.limbSwing += this.limbSwingAmount; } else { this.stepHeight = 0.5F; this.jumpMovementFactor = 0.02F; super.moveEntityWithHeading(p_70612_1_, p_70612_2_); } } } Thank you so much! I. Am. A. Noob. Noobs.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.