Started by
Blaziken77mw
on
Topic category: Help with MCreator software
I'm trying to make an item that moves the player in the direction they are looking when they hold right click, but I haven't been able to find a way to get the direction they're looking into the motion vector
I have a code that makes the player gain momentum towards the direction they are looking.
maybe it will help you.
You only have to copy the code that is marked in red, you leave it, it does not work for you.
Explanation: You can't get a vector, since there are no procedural blocks that do it (with code maybe), but you can get the Angle at which Steve's head turns (Yaw), only with a simple transformation you can get the unit vector of X and Z shown in the image.
what category is the [set local yaw to] block in?
local yaw is a number variable
This still helps me to this day
I'm not sure how to do it with procedural blocks, but the code goes something like
player.setDeltaMovement(player.getDeltaMovement().add(player.getForward()));
Kuri_Pa paste the screenshot I need this
guy I dont know Imy plugin changed but I think I solve it if anyone need this is the solution (I install player animation plugin and gecko lib and I use 1.20.1 version)
https://imgur.com/gallery/uCDmfSg
sorry
thats the marked one
https://imgur.com/gallery/QgT16Gs
I got it to work apart from y, how do I make the player move in the y direction as well?
I second the last reply
where would i find the "set local yaw" block?