Help with making a wither skull shooting weapon

Started by Grimlock on Fri, 08/05/2022 - 19:24

Topic category: Help with modding (Java Edition)

Last seen on 01:08, 2. Oct 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Help with making a wither skull shooting weapon
Fri, 08/05/2022 - 19:42 (edited)

I've already got my weapon to shoot wither skulls, but I want them to shoot in the direction I'm looking in. Any way to do this?

Β 

image of the code

Edited by Grimlock on Fri, 08/05/2022 - 19:42
Last seen on 01:08, 2. Oct 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Bump
Fri, 08/05/2022 - 21:10

Bump

Last seen on 20:08, 25. Sep 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I guess the simplest method…
Fri, 08/05/2022 - 21:47

I guess the simplest method would be to override the motion vector of the skull based on the direction the player is facing. (Their 'Yaw.') I've done something sort of like this before, but it only required eight directions, so I just checked whether the yaw was within a certain range, and launched the player in a direction accordingly- if you want your weapon to be more precise, it'll be trickier.

...I guess I recommend tinkering with look-angle vectors? I'm not entirely sure. Alternatively, you could make a projectile weapon with a custom projectile that looks and behaves like a wither skull, exploding and inflicting wither in a radius on impact.