Download WASD Detection — Minecraft Mods — MetaMods
WASD Detection

WASD Detection

Active

Downloads

0

Last update

1 year ago

Versions

1.19.2 — 1.21.1
Server
Game mechanics
Technological
Utils

WASD Detection

Accurate WASD key detection for Minecraft datapacks.

Compatible Minecraft Versions

Java Edition 1.20.2 - 1.21 (Pack versions for 1.20.1 and 1.19.2 also available in versions section)

How to Use the Datapack

Full video explanation

The WASD detection system works as an in-game predicate that can be accessed through /execute commands or player selectors.

/execute as @a if predicate wasd:w run say pressed w
/execute as @a[predicate=wasd:w] run say pressed w

Either of these commands will result in a "pressed w" message appearing in chat when the player moves forward.

List of Predicates

(All predicates have the prefix wasd:)

  • wasd:w = player moves forward
  • wasd:a = player moves left
  • wasd:s = player moves right
  • wasd:d = player moves backward
  • wasd:moving = player pressed any of the four directional keys
  • wasd:space = player moves upward
  • wasd:falling = player moves downward
  • wasd:shift = player presses SHIFT

Locking Player Movement

If you want to lock player movement, execute this command:

/execute as @a run function wasd:lock

This will lock all players at their current positions.

To lock a player at a specific location, execute:

/execute as @a positioned <XYZ> rotated <Y ROTATION> <X ROTATION> run function wasd:lock

Replace <XYZ> with desired coordinates, and <Y ROTATION> and <X ROTATION> with desired rotation angles.

To unlock players, execute:

/execute as @a run function wasd:unlock

Installation

Method 1 (Existing World)

  1. Navigate to .minecraft/saves//datapacks folder
  2. Paste the downloaded .zip file into this folder
  3. Enter your Minecraft world and type /reload
  4. A "Datapack Installed" message should appear

Method 2 (New World)

  1. In the Create new world screen, click the "Datapacks" button
  2. Drag and drop the downloaded .zip file into the game window
  3. Apply the datapack
  4. Create new world
Project members
JDawgtor

JDawgtor

Developer

Created: 1 Sep 2024

ID: 56195