Minecraft Data Packs / Tool

WASD Detection

  • check_circle Functions
  • check_circle Predicates
  • 1,216 views, 2 today
  • 49 downloads, 0 today
  • 10
  • 6
Cloud_Wolf avatar Cloud_Wolf
Level 42 : Master Engineer
76
WASD Detection

This pack allows you to detect the WASD input keys from the player!



How to use:

Mounted WASD:
  (for datapacks where @s is a player)
  execute if predicate wasd:is_mounted run function wasd:mounted
  execute if score .w wasd matches 1 run say w

  (for command blocks or datapacks where @s is not yet the player)
  execute as @a if predicate wasd:is_mounted run function wasd:mounted
  execute as @a[​tag=wasd.w] run say w

Walking WASD:
  (for datapacks where @s is a player)
  function wasd:walking
  execute if score .w wasd matches 1 run say w

  (for command blocks or datapacks where @s is not yet the player)
  execute as @a run function wasd:walking
  execute as @a[​tag=wasd.w] run say w


Benefits:
- Detect WASD inputs either via tags or fake player scores (<- this one is more efficient)
- Very low command count and very very efficient / optimized


Drawback:
- Rarely, there is miss input
- First tick of input is usually going to be wrong
(but all subsequent key detections are more accurate than competitors)


For more info watch the video





Installation:
1) Download the .zip
2) Unpack the zip
3) drag the folder into your .minecraft/saves/(world_name)/datapacks folder
CompatibilityMinecraft 1.17
toMinecraft 1.18
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2022
www.planetminecraft.com

Welcome