Started by
WizzardTV
on
Topic category: Help with Minecraft modding (Java Edition)
(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
You could make a procedure to check if the player is shooting, and if they are holding your item. If so, shoot projectiles.
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?
I would probably use its own procedure, but it might work with the player uses or something like that.
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.
For the own procedure, try on tick update, that way every tick it checks to shoot.
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!
Your welcome! Sorry if I was confusing. Let me know if you ned more help!
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?
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.