Started by
Wisy
on
Topic category: Help with Minecraft modding (Java Edition)
I'm not sure if this is possible, but i would like to make it where if you right click near the entity with an empty hand it will be thrown into the direction you are facing, think like pikmin (i am working on a pikmin mod after all) Any help is appreciated! ^ ^
Here's the exact code to make an entity fly away from you when you right click them with an empty hand. You can change around the values where the look angle vector is multiplied by 2 if you want them to fly further or shorter, and you'll have to select your entity rather than "CornballMan." Another note is that when you grab the blocks they'll have horizontal inputs, but they are the same block and work the same, I just like the organization of vertical inputs.
And if you were wanting to hold the entity in your hand, here's how you'd do that. Put the attached code into whatever trigger you want to use to activate holding it. You may have to change out the 'event/target entity' blocks with 'source entity' blocks depending on what trigger you use. The set rotation doesn't look the best in game, it works just fine if you remove it. I'd also suggest you turn off collisions on your entity. And lastly, I don't suggest changing the value that have 230 in them unless you understand trigonometry pretty well and understand what the code is saying, but changing the values with 2 in them will change how far away the entity will be from you.
holy cow, you are a lifesaver !!! THANKS SO MUCH :D
No problem, glad I could help!
PhatBoi i love you