"@v (view)" Is a new target selector that detects or executes on the entity or block that is blocking the view of the person executing the command:
Example Command: /execute as @v at @s run say Hello World!
Example result: The command is executed as the entity located at the direction the executor is facing. However, if a solid block were to obstruct that path between the executor and the target, the command would fail.
"looking_at" It is, in fact, a piece of information that already appears on the debug screen when you press F3, but which cannot be accessed directly via commands. It would be nice to be able to access that information so we can execute commands directly on the block the player is looking at, as well as know which block is being viewed.
Example Command 1: /execute positioned on looking_at run setblock ~ ~ ~ minecraft:stone
Example Command 2: /execute positioned on looking_at if block ~ ~ ~ minecraft:redstone run setblock ~ ~ ~ minecraft:stone
Both implementations would simplify many of the datapack techniques that attempt to replicate this type of detection; although these techniques are functional, they are not as accurate, are still limited, or are far from optimal in terms of resource usage.
Please sign in to leave a comment.
0 Comments