Help with making a wither skull shooting weapon

Started by Grimlock on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.