Movement Functions - anon-noob/mothball GitHub Wiki

Movement Functions

Movement functions move the player through various means. Currently, Mothball supports sprinting, sneaking, and jumping on ground, air, and water movement (it does not support 1.13+ swimming).

All movement functions have aliases, which means you can call the same function with different names.

Common Characteristics

Normal and 45 Variants

All movement functions have a normal variant and a 45 variant. The 45 variant will automatically 45 strafe and gain as much distance as possible. Simply append 45 after a function to make it a 45 variant, for example walk becomes walk45.

Unless otherwise stated, function45 is equivalent to function.wa(1,45). For example, walk45 is equivalent to walk.wa(1,45).

Common Arguments

Since multiple functions share the same arguments, here will be an explanation for these arguments.

argument name datatype default value details
duration int ≥ 0 1 Sets the duration of the movement in ticks
rotation float None Sets the player's rotation (also known as the angle they are facing) for just that function. It does not update the default rotation. For that, see the appropiate setter functions.
slip float ≥ 0 None (KEYWORD ONLY ARGUMENT) Sets the ground slipperiness for just that function. It does not update the default ground slipperiness. For that, see setslip()
speed int ≥ 0 None (KEYWORD ONLY ARGUMENT) Sets the speed potion amplifier for just that function. It does not update the default potion effects. For that, see speed()
slow int ≥ 0 None (KEYWORD ONLY ARGUMENT) Sets the slowness potion amplifier for just that function. It does not update the default potion effects. For that, see slow(). Note that slow 7 and beyond are equivalent. See here for an explanation.

If no value is provided to arguments that default to None, then it will use the default attributed values that the player has. For example, if the default rotation is set to 3.4, then any time the rotation argument is not explicitly stated, it will default to None, which will tell Mothball to use the default attributed value, in this case, 3.4.

It is important to understand that the arguments rotation, slip, speed, and slow does NOT update the default attributes. For example, slow(1) walk sprint(slow=0) sneak is equivalent to walk(slow=1) sprint sneak(slow=1).

Prepending Negatives and Appending Inputs

All movement functions can be appended with inputs using the syntax function.inputs where inputs is a combination of wasd. For example, walk.sd.

All movement functions can also be prepended with - using the syntax -function.inputs which will invert inputs. For example, -walk.sd is equivalent to walk.wa.

A Suggestion on Prepending and Appending

We recommend not appending inputs when using the 45 variants of functions for the sake of clarity. So please try to avoid typing walk45.sd.

We also recommend only prepending a function with - if its equivalent is a function with s as its appended input. This is also for the sake of clarity.

Walk

# Other Aliases: w
walk(
  duration: int = 1,
  rotation: float = None,
  *,
  slip: float = None
  speed: int = None,
  slow: int = None
)

Sprint

# Other Aliases: s
sprint(
  duration: int = 1,
  rotation: float = None,
  *,
  slip: float = None
  speed: int = None,
  slow: int = None
)

Sneak

# Other Aliases: sn
sneak(
  duration: int = 1,
  rotation: float = None,
  *,
  slip: float = None
  speed: int = None,
  slow: int = None
)

Sneaksprint (1.14+ only)

# Other Aliases: sns
sneaksprint(
  duration: int = 1,
  rotation: float = None,
  *,
  slip: float = None
  speed: int = None,
  slow: int = None
)

In game, the player must be sprinting on the tick before they sneak in order to be able to sneaksprint.

Walkair

# Other Aliases: wa
walkair(
  duration: int = 1,
  rotation: float = None
)

Sprintair

# Other Aliases: sa
sprintair(
  duration: int = 1,
  rotation: float = None
)

Minecraft versions 1.19.3 and below have a midair sprint delay. If sprint is activated in midair, the actual sprint multiplier is toggled 1 tick later than usual. In other words, ;s wa(2) sa(4) in modern versions (1.19.4 and above) is equivalent to ;s wa(1) sa(5) in older versions.

Sneakair

# Other Aliases: sna
sneakair(
  duration: int = 1,
  rotation: float = None
)

Sneaksprintair (1.14+ Only)

# Other Aliases: snsa
sneaksprintair(
  duration: int = 1,
  rotation: float = None
)

In game, the player must be sprinting on the tick before they sneak in order to be able to sneaksprintair. This also includes sprint air delay.

Walkjump

# Other Aliases: wj
walkjump(
  duration: int = 1,
  rotation: float = None,
  *,
  slip: float = None
  speed: int = None,
  slow: int = None
)

After jump, the player is airborn. Equivalent to wj(1) wa(duration - 1).

Sprintjump

# Other Aliases: sj
sprintjump(
  duration: int = 1,
  rotation: float = None,
  *,
  slip: float = None
  speed: int = None,
  slow: int = None
)

After jump, the player is airborn. Equivalent to sj(1) sa(duration - 1).

sj45(duration) is equivalent to sj sa45(duration - 1). This is because sprint jumping straight and 45 strafing midair is the best way to maximize distance.

Sneakjump

# Other Aliases: snj
sneakjump(
  duration: int = 1,
  rotation: float = None,
  *
  slip: float = None
  speed: int = None,
  slow: int = None
)

After jump, the player is airborn. Equivalent to snj(1) sna(duration - 1).

Sneaksprintjump (1.14+ Only)

# Other Aliases: snsj
sneaksprintjump(
  duration: int = 1,
  rotation: float = None,
  *,
  slip: float = None
  speed: int = None,
  slow: int = None
)

After jump, the player is airborn. Equivalent to snsj(1) snsa(duration - 1).

The 45 variant sneaksprintjump45 or snsj45 finds the best jump angle to maximize distance when sprint jumping with w AND strafe as this is actually stronger than jumping straight with just w.

Sprintstrafejump

# Other Aliases: strafejump, stfj
sprintstrafejump(
  duration: int = 1,
  rotation: float = None,
  *,
  slip: float = None
  speed: int = None,
  slow: int = None
)

After jump, the player is airborn. Equivalent to stfj(1) sa(duration - 1).

This function finds the best jump angle to maximize distance when sprint jumping with w AND strafe (which is weaker than sprint jumping with just w).

stfj(1) is equivalent to stfj45(1), and stfj45(duration) is equivalent to stfj45(1) sa45(duration-1).