1
Another problem that i need help with
I am trying to make an item enable flying for the player. i have found MrArcanes jetpack tutorial but I need to make it for an item and 1.3.2 can some one help me on that
heres MrArcanes tutorial code
i would take out the particles too
heres MrArcanes tutorial code
First you need to add this to the top:
private static boolean hasJetpack = false;
Then add this:
public boolean onTickInGame(float f, Minecraft minecraft)
{
if (minecraft.thePlayer.inventory.armorItemInSlot(2) != null)
{
ItemStack itemstack = minecraft.thePlayer.inventory.armorItemInSlot(2);
if (itemstack.itemID == ArmorNameHere.shiftedIndex)
{
if (minecraft.currentScreen == null && Keyboard.isKeyDown(minecraft.gameSettings.keyBindJump.keyCode))
{
if (minecraft.thePlayer.motionY > 0.0D)
{
minecraft.thePlayer.motionY += 0.084999999105930327D;
}
else
{
minecraft.thePlayer.motionY += 0.11699999910593033D;
}
minecraft.theWorld.spawnParticle("smoke", minecraft.thePlayer.posX, minecraft.thePlayer.posY - 1.0D, minecraft.thePlayer.posZ, 0.0D, 0.0D, 0.0D);
}
if (minecraft.thePlayer.motionY < 0.0D)
{
minecraft.thePlayer.motionY /= 1.1499999761581421D;
}
if (!minecraft.thePlayer.onGround)
{
minecraft.thePlayer.motionX *= 1.0399999618530273D;
minecraft.thePlayer.motionZ *= 1.0399999618530273D;
}
minecraft.thePlayer.fallDistance = 0.0F;
hasJetpack = true;
}
else
{
hasJetpack = false;
}
}
return true;
}i would take out the particles too
