Jump to content

Recommended Posts

Posted

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.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.