Posted March 16, 20169 yr I am trying to make the player shoot upwards when my projectile hits it. This works on other entities, but not on other players. I use entity.addVelocity() for shooting them upwards. However, when I added a line of code to do damage after that, the player shot up and took damage. What's going on? I use entity.attackEntityFrom() for the damage. I use my custom damage source for the param. Thanks Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 16, 20169 yr This is all from memory, so it may not be entirely accurate: when the player takes damage, there is a field that gets set to true - something like #velocityChanged - that acts as a flag for the server to notify the client of specific motion changes. You can accomplish the same thing by sending a motion packet to the client or running your code on both sides. http://i.imgur.com/NdrFdld.png[/img]
March 16, 20169 yr Author How would I send a packet to the client? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 17, 20169 yr if (target instanceof EntityPlayerMP && !target.worldObj.isRemote) { ((EntityPlayerMP) target).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(target)); } http://i.imgur.com/NdrFdld.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.