Java Code Examples for net.minecraft.client.entity.EntityPlayerSP#setPosition()

The following examples show how to use net.minecraft.client.entity.EntityPlayerSP#setPosition() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VClipCmd.java    From ForgeWurst with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void call(String[] args) throws CmdException
{
	if(args.length != 1)
		throw new CmdSyntaxError();
	
	if(!MathUtils.isInteger(args[0]))
		throw new CmdSyntaxError();
	
	EntityPlayerSP player = WMinecraft.getPlayer();
	player.setPosition(player.posX, player.posY + Integer.parseInt(args[0]),
		player.posZ);
}
 
Example 2
Source File: LongJump.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
@EventTarget
public void onUpdate(final UpdateEvent event) {
    if(LadderJump.jumped)
        MovementUtils.strafe(MovementUtils.getSpeed() * 1.08F);

    if(jumped) {
        final String mode = modeValue.get();

        if (mc.thePlayer.onGround || mc.thePlayer.capabilities.isFlying) {
            jumped = false;
            canMineplexBoost = false;

            if (mode.equalsIgnoreCase("NCP")) {
                mc.thePlayer.motionX = 0;
                mc.thePlayer.motionZ = 0;
            }
            return;
        }

        switch (mode.toLowerCase()) {
            case "ncp":
                MovementUtils.strafe(MovementUtils.getSpeed() * (canBoost ? ncpBoostValue.get() : 1F));
                canBoost = false;
                break;
            case "aacv1":
                mc.thePlayer.motionY += 0.05999D;
                MovementUtils.strafe(MovementUtils.getSpeed() * 1.08F);
                break;
            case "aacv2":
            case "mineplex3":
                mc.thePlayer.jumpMovementFactor = 0.09F;
                mc.thePlayer.motionY += 0.0132099999999999999999999999999;
                mc.thePlayer.jumpMovementFactor = 0.08F;
                MovementUtils.strafe();
                break;
            case "aacv3":
                final EntityPlayerSP player = mc.thePlayer;

                if(player.fallDistance > 0.5F && !teleported) {
                    double value = 3;
                    EnumFacing horizontalFacing = player.getHorizontalFacing();
                    double x = 0;
                    double z = 0;
                    switch(horizontalFacing) {
                        case NORTH:
                            z = -value;
                            break;
                        case EAST:
                            x = +value;
                            break;
                        case SOUTH:
                            z = +value;
                            break;
                        case WEST:
                            x = -value;
                            break;
                    }

                    player.setPosition(player.posX + x, player.posY, player.posZ + z);
                    teleported = true;
                }
                break;
            case "mineplex":
                mc.thePlayer.motionY += 0.0132099999999999999999999999999;
                mc.thePlayer.jumpMovementFactor = 0.08F;
                MovementUtils.strafe();
                break;
            case "mineplex2":
                if(!canMineplexBoost)
                    break;

                mc.thePlayer.jumpMovementFactor = 0.1F;

                if(mc.thePlayer.fallDistance > 1.5F) {
                    mc.thePlayer.jumpMovementFactor = 0F;
                    mc.thePlayer.motionY = -10F;
                }
                MovementUtils.strafe();
                break;
        }
    }

    if(autoJumpValue.get() && mc.thePlayer.onGround && MovementUtils.isMoving()) {
        jumped = true;
        mc.thePlayer.jump();
    }
}