Minecraft - How to testfor players WASD input for 2D maps without the camera visual glitch!
Its amazing! I cant believe that me and my friend vanjmali accidentally discovered this! We were messing around with cameras and teleportations when I saw vanjmali using the attribute command. I noticed that you can set your speed with pinpoint accuracy and thought of having it at the lowest possible number and still have the player be able to move. Then after some tests with the teleport and movement testfor that I already made, it works with the lowest speed possible and very barely moves the player at all! You can barely notice the teleportation movement at all! I feel like this will help a lot with map makers that are making 2d platformer maps and much more! Also, no need for credit, but if you want, you can and it would be much appreciated too! Thank you for reading this, and here's the commands!
(also, I need to do more testing, but this was mainly copy pasted from an entity, so make sure to summon an entity where the player should be and make it a marker. Also dont forget the tag "tv" or whatever tag you want, just dont forget to change it in the command if its not tagged as tv.)
-
-Apply attributes
execute as @a[gamemode=adventure] at @s run attribute @s minecraft:generic.movement_speed base set 0.0004
-Testfor player movements
-North
execute as @e[tag=tv] at @s positioned ^ ^ ^-0.1876 if entity @a[gamemode=adventure,distance=0..0.18759] run say W
-East
execute as @e[tag=tv] at @s positioned ^0.1876 ^ ^ if entity @a[gamemode=adventure,distance=0..0.18759] run say D
-South
execute as @e[tag=tv] at @s positioned ^ ^ ^0.1876 if entity @a[gamemode=adventure,distance=0..0.18759] run say S
-West
execute as @e[tag=tv] at @s positioned ^-0.1876 ^ ^ if entity @a[gamemode=adventure,distance=0..0.18759] run say A
-Force TP
execute as @e[tag=tv] at @s run tp @p[gamemode=adventure] ^ ^ ^ 180 0
-Reset Speed If Not In Adventure
execute as @a[gamemode=!adventure] at @s run attribute @s minecraft:generic.movement_speed base set 0.1
-Loop
schedule function (this function) 1t
Other Videos By HEAL Pony
Other Statistics
Minecraft Statistics For HEAL Pony
At present, HEAL Pony has 5,231,265 views spread across 87 videos for Minecraft, and roughly 2 days worth of Minecraft videos were uploaded to his channel. This makes up 41.29% of the content that HEAL Pony has uploaded to YouTube.