I made a dragon, but i try to make it extend horse so you can ride it, add some of the flying code from the ghast class, but it does not work. I need help, would be well appreciated.
Copy paste the class from the ghast class to get it to fly, and make it extend dragon but make it passive. Then take the EntityRideable stuff and put it in there too! I think this might help!
Where would i find the jump sneak code and does the code have to be modified for ascending/descending? I made it rideable, and flyable, but i cant make it ascend or descend
Big nono here! The ghast code is pretty cheap. It has zero intelligent yet, I don't know why they still haven't made any AI for the nether mobs, Withers and now also pigmen (which also took away too long to add existing code to them) are the only nether creatures with AI.
You can easily copy the entityhorse's code, and to make it flyable by either use jump/sneak or the rotationyaw of the player, when the player is looking up, you make the ridden entity ascent , and it's looking down, your ridden entity will of course descent until it hits the ground.
I agree but it seems to be the easiest way out. Just a quick question, is there a reason you think that? Prior experience or something?
Actually it is not ´the easiest way out´. The ghast has the same intelligence as squids, none. It moves towards 1 random direction for x random ticks. which will make your entity not controllable, because it will try to force your entity to that random direction, this can be blocked by the user's input but it will make your entity jittery. Also it will randomly ascent and descent, which can place the player into the wall or in to lava or what ever.
how do i make the mob ascend/descend by looking up and down? Here is code though it only works when you turn the mouse sideways, it goes up when you move it right, and down when you move the mouse left
code:
public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_)
Hello!
I agree but it seems to be the easiest way out. Just a quick question, is there a reason you think that? Prior experience or something?
Hello!
Ahh, I see. Makes sense! Thanks!
Hello!
code:
public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_)
{
if (riddenByEntity != null)
{
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;
this.posY = this.rotationYawHead = this.renderYawOffset = this.rotationYaw;
p_70612_1_ = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 4.5F;
p_70612_2_ = ((EntityLivingBase)this.riddenByEntity).moveForward;
this.isAirBorne = true;
if (p_70612_2_ > 0.0F)
{
float f2 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F);
float f3 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F);
}
net.minecraftforge.common.ForgeHooks.onLivingJump(this);
}
this.stepHeight = 4.0F;
this.jumpMovementFactor = this.getAIMoveSpeed() * 4.0F;
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;
}
code
this.posY = this.rotationPitch;
this.yOffset = this.rotationPitch;
But it is inverse, and you have to keep pulling the mouse up or down to keep ascending or descending
sneak = descend
jump = ascend
okay i think i can do this now
ill take a look at creative flight
But i think i like the sneak/jump thing better
im doing something similar but i dont now what part of the house mount code to use since im making a vehicle which part did u use