Fire a fireball when a key is pressed

Started by myxical on

Topic category: Help with modding (Java Edition)

Last seen on 23:47, 20. Jan 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Fire a fireball when a key is pressed

I want the fireball to be fired from the player, I don't want to spawn a still fireball that needs to be punched. I want it under a keybind.

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you could make a custom…
Thu, 09/09/2021 - 23:18

you could make a custom Ranges Item exactly like a fire ball

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ranged*
Thu, 09/09/2021 - 23:18

Ranged*

Last seen on 23:47, 20. Jan 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want the vanilla one, just…
Fri, 09/10/2021 - 12:04

I want the vanilla one, just like ghasts fire them. That's not the solution I want

Last seen on 23:47, 20. Jan 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know how to summon a…
Sat, 09/11/2021 - 10:20

I know how to summon a fireball. I know minecraft commands. How do I give it motion from the direction of the player?

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
should be plenty of videos…
Sat, 09/11/2021 - 15:39

should be plenty of videos for that

Last seen on 23:47, 20. Jan 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
maybe help me and give me a …
Sun, 09/12/2021 - 10:47

maybe help me and give me a "video for that"?

Last seen on 17:15, 28. Mar 2024
Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry that RexCerv has been…
Sun, 09/12/2021 - 15:36

Sorry that RexCerv has been so unhelpful. I'm not sure if shooting a fireball is an option, but there is a procedure that does shooting a projectile. So you may want to make a custom ranged item. You don't have to do the item part, you just have to do the actual projectile. That makes it a part of your mod. Then you just go into your Key Binding and do "when pressed" shoot projectile. And then make it your custom projectile.

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
that's exactly what I told…
Sun, 09/12/2021 - 17:13

that's exactly what I told him he could do, be he said no custom projectiles

Last seen on 04:15, 27. Mar 2024
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What he's trying to do is…
Sun, 09/12/2021 - 18:54

What he's trying to do is summon a fireball that is already moving so the player doesn't have to hit it. The only way to do this is to create a command with direction values based on the direction the player is facing. This is extremely difficult without good knowledge of trigonometry.

Last seen on 23:47, 20. Jan 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I mean in theory it's just…
Sun, 09/26/2021 - 13:52

I mean in theory it's just to get the look of the player and apply that to fireball's direction and give it some velocity. But how would I make it in practice?

You can use command, they…
Sun, 09/26/2021 - 14:01

You can use command, they have velocity options. Unfortunately I know nothing how they can be used (I never understood them first of all), but it's totally doable.

Like, for example, here (it's for 1.12, but should work for newer versions too, maybe with some syntax corrections). You can use it for all vanilla projectiles, as I used it for dragon fireball myself.

Last seen on 23:47, 20. Jan 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello First, no this won't…
Thu, 09/30/2021 - 12:17

Hello

First, no this won't work, since /execute has been rewritten, second this is unreliable. Executing some commands instead instead of just summoning the fireball can cause some problems. I know how I would do it: summon an arrow, replace the arrow with a fireball instead... wait, how do I keep the motion tho?

And a problem from MCreator is that everything happens in one tick, meaning it won't replace any arrows because they are only registered in the second tick (at least that's what I think would happen - tried making a lucky block once that generates a random number, but that won't work since drops are determined by the value - and if the value isn't rolled it won't drop. so the number rolls, but it doesn't actually drop anything. I can't delay it because you can't use wait blocks in breaking procedures)

conclusion: I need to learn java

You can't use "wait"…
Thu, 09/30/2021 - 13:50

You can't use "wait" procedure, but you can, possibly, make loop.

Let's say you make variable which is firstly set to 0. Let's name it x.
Then, you create "while x < 30":
set x to x+1
if x = 20 //exactly one second/20 ticks:

- do something which you want
else:
break