Just in-case you didn't notice by the totally relevant title, I need help. Really. I do.
PREPARE! This is gonna sound awkward coming from an old time modder like myself...
How do I make an arrow shoot in the direction of that the player is facing. I have never worked with getRot() getSin() and all those other functions that creep me out. I will help you in return if you need anything, and if I can help. If not, thanks for at least helping me.
I am planning on making a sniper mod just for personal use and I really need to know how to use those functions and stuff to make a sniper. I am gonna display a text crosshair on the screen as a scope and then you pull the virtual trigger and it shoots
Also, I don't want it to shoot two blocks in front of you. I want it to go far. Please.
Thanks in advance.
Rollback Post to RevisionRollBack
Willing to work on Android apps or multi-platform games, see profile bio for information.
Just in-case you didn't notice by the totally relevant title, I need help. Really. I do.
PREPARE! This is gonna sound awkward coming from an old time modder like myself...
How do I make an arrow shoot in the direction of that the player is facing. I have never worked with getRot() getSin() and all those other functions that creep me out. I will help you in return if you need anything, and if I can help. If not, thanks for at least helping me.
I am planning on making a sniper mod just for personal use and I really need to know how to use those functions and stuff to make a sniper. I am gonna display a text crosshair on the screen as a scope and then you pull the virtual trigger and it shoots
Also, I don't want it to shoot two blocks in front of you. I want it to go far. Please.
Thanks! I think I might just examine the code from that big modpack that used to be around (I can't think of the name) that QyMineASAP (I think that's his name) made. They made it. Maybe DroidControl (it has the same thing done with TNT.
Rollback Post to RevisionRollBack
Willing to work on Android apps or multi-platform games, see profile bio for information.
Thanks! I think I might just examine the code from that big modpack that used to be around (I can't think of the name) that QyMineASAP (I think that's his name) made. They made it. Maybe DroidControl (it has the same thing done with TNT.
O.o the great temena.... I had the code for it on my laptop................ Well, I see you have 500ise helping you. you need no more help.
U r using entityAddedHook right? Kik me.
lol.
On Kik everybody says I'm a "genius" when really, I am just an average coder. So maybe I'm a little more experienced than you and Noahz but I'm still not a "genius" as people claim.
It will be set up like this:
//GUI HERE
//ON BUTTON PRESS
//SPAWN ARROW
//USE [url="http://www.minecraftforum.net/user/2593821-beatz-unknown/"]BeATz_UnKNoWN[/url]'s CODE FOR SHOOTING FAR
//END
Willing to work on Android apps or multi-platform games, see profile bio for information.
Founder and CEO of Temena Development
Twitter: @TemenaPE
Instagram: @ItsLiterallyMath
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumUhh... copy the relevant stuff from Desktop Edition source? https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/EntityArrow.java#L63
Thanks! I think I might just examine the code from that big modpack that used to be around (I can't think of the name) that QyMineASAP (I think that's his name) made. They made it. Maybe DroidControl (it has the same thing done with TNT.
Willing to work on Android apps or multi-platform games, see profile bio for information.
Founder and CEO of Temena Development
Twitter: @TemenaPE
Instagram: @ItsLiterallyMath
if(getPitch(getPlayerEnt())>40){ var playerYaw = Entity.getYaw(Player.getEntity()); var playerPitch = Entity.getPitch(Player.getEntity()); velY = Math.sin((playerPitch - 180) / 180 * Math.PI); velX = Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI); velZ = -1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI); entity = Level.spawnMob(Player.getX() + velX * 2, Player.getY(), Player.getZ() + velZ * 2, entityType); setVelX(entity, velX * 2); setVelY(entity, velY); setVelZ(entity, velZ * 2); } if(getPitch(getPlayerEnt())<40){ var playerYaw = Entity.getYaw(Player.getEntity()); var playerPitch = Entity.getPitch(Player.getEntity()); velY = Math.sin((playerPitch - 180) / 180 * Math.PI); velX = Math.sin(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI); velZ = -1 * Math.cos(playerYaw / 180 * Math.PI) * Math.cos((playerPitch - 180) / 180 * Math.PI); entity = Level.spawnMob(Player.getX() + velX * 2, Player.getY() + 1, Player.getZ() + velZ * 2, entityType); setVelX(entity, velX * 2); setVelY(entity, velY); setVelZ(entity, velZ * 2); }Full credit to thecactigod. If the player gets hurt, don't blame me, because I was messing around with the code a bit.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
U r using entityAddedHook right? Kik me.
lol.
On Kik everybody says I'm a "genius" when really, I am just an average coder. So maybe I'm a little more experienced than you and Noahz but I'm still not a "genius" as people claim.
It will be set up like this:
Thanks!
Willing to work on Android apps or multi-platform games, see profile bio for information.
Founder and CEO of Temena Development
Twitter: @TemenaPE
Instagram: @ItsLiterallyMath
modTick();
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]