ClientInput .java

net.minecraft.client.player.ClientInput (class): members: hasForwardImpulse, getMoveVector, keyPresses, moveVector, makeJump, tick. imports: Input, Vec2.

net.minecraft.client.playerclass36 linesclient747 B

API Surface (4)

void tick()
Vec2 getMoveVector()
boolean hasForwardImpulse()
void makeJump()

Fields & Constants (2)

keyPresses
moveVector

Code Graph: Dependencies (2)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ClientInput.java36 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.player;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.world.entity.player.Input;
6
import net.minecraft.world.phys.Vec2;
7
8
@Environment(EnvType.CLIENT)
9
public class ClientInput {
10
	public Input keyPresses = Input.EMPTY;
11
	protected Vec2 moveVector = Vec2.ZERO;
12
13
	public void tick() {
14
	}
15
16
	public Vec2 getMoveVector() {
17
		return this.moveVector;
18
	}
19
20
	public boolean hasForwardImpulse() {
21
		return this.moveVector.y > 1.0E-5F;
22
	}
23
24
	public void makeJump() {
25
		this.keyPresses = new Input(
26
			this.keyPresses.forward(),
27
			this.keyPresses.backward(),
28
			this.keyPresses.left(),
29
			this.keyPresses.right(),
30
			true,
31
			this.keyPresses.shift(),
32
			this.keyPresses.sprint()
33
		);
34
	}
35
}
36

Decompiled Minecraft 26.3 source of ClientInput (net/minecraft/client/player/ClientInput.java) with Mojang official mappings, stored verbatim on the site.