1
I'm designing a data pack that requires detecting the player's targeted block while holding a specific item in the primary hand. At first, I thought it would be easy if there's an NBT tag for the player entity, but I cannot find it anywhere. Raycasting can be one way of doing it, but I want the exact block the player can touch, not just look at, i.d., the player can break (left) or interact (right) with the block right now. Is there any simple way of doing it? I will be grateful if anyone provides a tutorial or an example data pack I can learn with.
Create an account or sign in to comment.
1
I think I just figured it out. Is this right?
execute as @p anchored eyes positioned ^ ^ ^ run ...
execute as @p anchored eyes positioned ^ ^ ^ run ...