name = "SimpleFly"
description = "Makes you fly"

function onUpdate()
	local speed = 0.3
	local motionY = 0.0
	
	if player.moving then
		player.setSpeed(speed)
	else
		player.stop()
	end
	
	if settings.jumpDown or settings.jumpPressed then
		motionY = speed
	elseif settings.sneakDown or settings.sneakPressed then
		motionY = -speed
	end
	
	player.setMotion(player.motionX, motionY, player.motionZ)
end