How do I make a ranged weapon that fires a wither head in the direction I'm looking?

Started by Ahmet Enes TAŞÇI on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a ranged weapon that fires a wither head in the direction I'm looking?

Hello. As you know, the wither head is not actually a complete entity. Wither's head is built into Wither's model, and when he fires it, this part breaks away from Wither's model and turns into an entity. I also made a special skull for myself (as a java entity model). How can I make it go forever, just like the wither head? I also want it to fire in the direction I'm looking. We can put a special bullet model as a java entity model in a normal ranged weapon making interface. but I don't want this. Because when adjusting the bullet power, it either escapes too much or becomes too weak. It can also become crooked. Long story short, I want to make a ranged weapon that moves straight at a constant speed, just like the wither head, and creates an explosion when it hits a block or mob. Can you post a photo of this procedure?

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You may want to consider…
Tue, 09/19/2023 - 22:37

You may want to consider using a custom entity instead of a projectile. It's easy enough to make an explosive projectile; just have a procedure that makes an explosion, and have the ranged item run that procedure on impact. However, projectiles have hard-coded physics, whereas entities can have their momentum/gravity controlled with procedures.

Try instead making an item that summons a custom entity with no gravity and no AI, with all of its yaw/rotation/look angle vectors set to the same as the entity that spawned it. Then when the entity spawns, use the 'attempt to override motion-vector' function, and set the entity's velocity to its current look-angle vectors. (Multiplied by however fast you want it to go.) This should give you a projectile that flies in a perfectly straight line, which you can configure to explode on impact.

...All this being said, you can summon Wither Skulls, both with commands and with Mcreator. You should also be able to use the 'override motion vector' block to control their movement as well.