How can I detect a custom projectile?

Started by LilPerkins on

Topic category: Help with modding (Java Edition)

Last seen on 20:22, 16. Aug 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I detect a custom projectile?
Fri, 08/07/2020 - 19:21 (edited)

I am creating a mod with a baseball bat in it, and I would like the baseball bat to be able to hit back the custom projectiles I make. I would like to replace EntityArrow with something that includes custom projectiles. My current code is in the screenshot.  The rest of the code is off-screen but isn't necessary either. Any suggestions?

Picture of my current code.

Edited by LilPerkins on Fri, 08/07/2020 - 19:21
Last seen on 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not sure how much you…
Sat, 08/08/2020 - 01:31

I'm not sure how much you can adjust projectile entities once their in motion, I haven't looked into it, but at the very least if you made the projectile a living entity, you could probably just multiply each of the three (x y z) velocities by -1 when it is hit and the baseball bat is in the player's hand, reversing it's direction and speed exactly.

Last seen on 21:12, 25. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
P.S. I can't see the image.
Sat, 08/08/2020 - 01:32

P.S. I can't see the image.

Last seen on 20:27, 19. Apr 2024
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
first right click the image…
Sat, 09/26/2020 - 20:55

first right click the image an open it in a new tab, btw it wont work with that, I'm pretty sure it not possible with the blocks to redirect the projectile, although you could make it so if the player entity gets hit by it, it will despawn the projectile and, make the player shoot the same projectile, but I have no idea what blocks that would take