How to Constantly Fire While Bow is Drawn?

Started by WizzardTV on

Topic category: Help with modding (Java Edition)

Last seen on 04:46, 24. Jul 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to Constantly Fire While Bow is Drawn?
Wed, 12/06/2023 - 21:39 (edited)

(First of all, apologies as this is my first forum post.)
I am attempting to make a ranged item that is a sort of flamethrower/fire wand. I am using the bow animations in order for not only the player to appear to be aiming not only in first person but third person.
I want to make it so that when they are holding down right click/"drawing the bow back", the wand will shoot fireballs constantly.
I have tried using the bow animation with the "fire constantly" option for ranged items, but this causes it to do the swing animation rather than hold the bow animation.

Is there any way to make it so that it fires constantly while maintaining the drawn-back bow animation until you let go of rmb?

Edited by WizzardTV on Wed, 12/06/2023 - 21:39
Last seen on 20:18, 25. Jul 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could make a procedure…
Wed, 12/06/2023 - 12:11

You could make a procedure to check if the player is shooting, and if they are holding your item. If so, shoot projectiles. 

Last seen on 04:46, 24. Jul 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have made a procedure that…
Wed, 12/06/2023 - 21:03

I have made a procedure that checks if the item in main hand is the wand, the shoot power is greater than or equal to 0.1, and that they have fire charges in their inventory as ammo. I might be dumb but where do I put this procedure in the wand? When the player uses it, or is it its own procedure that is called upon when player right clicks with item?

Last seen on 20:18, 25. Jul 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I would probably use its own…
Wed, 12/06/2023 - 21:08

I would probably use its own procedure, but it might work with the player uses or something like that.

Last seen on 20:18, 25. Jul 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If this doesn't work, you…
Wed, 12/06/2023 - 21:11

If this doesn't work, you could make it an item, and when right clicked, give the player a potion effect that just shoots the fire projectile, and when the player finishes using it, get rid of it.

 

Last seen on 20:18, 25. Jul 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For the own procedure, try…
Wed, 12/06/2023 - 21:12

For the own procedure, try on tick update, that way every tick it checks to shoot.

Last seen on 04:46, 24. Jul 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ah, I made a mistake on my…
Wed, 12/06/2023 - 21:14

Ah, I made a mistake on my end by putting the shooting power segment into the code as it was making the procedure try to check if the wand itself was a projectile (causing it to not function), removing that this works perfectly as intended, thank you!

Last seen on 20:18, 25. Jul 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Your welcome! Sorry if I was…
Wed, 12/06/2023 - 21:20

Your welcome! Sorry if I was confusing. Let me know if you ned more help!

Last seen on 04:46, 24. Jul 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry there is one more…
Wed, 12/06/2023 - 21:35

Sorry there is one more thing actually,
Disabling the shoot constantly in the ranged item settings (leaving it on overrides to the punch animation) does make it only shoot once while its drawn back. Is there a way to loop the procedure to keep shooting until you run out of fireballs or let go of rmb?

Last seen on 20:18, 25. Jul 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Put code checking if the…
Thu, 12/07/2023 - 08:32

Put code checking if the player is holding the item and has shooting power in player tick. Put it in its own procedure with trigger player tick.