Started by
Kvngsavage118
on
Topic category: Help with Minecraft modding (Java Edition)
I need help with a procedure that would launch a custom entity in the same direction I am looking.
Topic category: Help with Minecraft modding (Java Edition)
I need help with a procedure that would launch a custom entity in the same direction I am looking.
Use this code, you may have to change around source entity and event/target entity depending on how you have your procedure set up.
It only fires to negative Z when I use this procedure.
What trigger do you have the procedure in? And could you take a screenshot of the code you put in it?
I have it in the "On entity tick update" section and here's the link https://imgur.com/wP8AYMV
Okay, I see the issue. You have event/target entity as the entity type for the get look angle vector values. Those need to be referencing the player, but also you’ll probably need to put that whole block in a different trigger, because if it’s in an update tick it will send it flying in the direction you’re facing 20 times per second. I’d suggest you put it in a global procedure or an event that is not so often or is controlled, like if the entity is right clicked. With that example, you’d need to put ‘source entity’ into the get look angle vector blocks instead of event/target entity.
Oh and another reason you need to change which trigger you’re using is because source entity is not an available dependency inside the update tick procedure.
So how would I go about doing that? Is there any way you can show me an example?
Well the example I have here is when a player right clicks with an empty hand on the entity, it is pushed away in the direction the player is facing. The difference between this code and the one you have is yours calls "event/target entity" for which entity's direction you are wanting as well as the entity you're trying the launch. The result is the entity just moves straight in the direction it is facing. I would suggest putting your code in either a global trigger like mine or in a trigger which has "entity" as well as "source entity" dependencies, otherwise this code will not work. And just for clarification, make sure you are using "source entity" block when getting the look angle vector values.
Thank you for helping. I figured it out a few days before you posted this.
No problem