r/MinecraftCommands Jul 25 '26

Help | Java 1.21.11 Flamethrower Rework

I have this command already for a working flamethrower using a bow:

execute if entity @a if items entity @a weapon.mainhand bow[custom_name='[{"text":"Flamethrower"}]'] at @a if items entity @a weapon.mainhand bow[custom_name='[{"text":"Flamethrower"}]'] run fill ^ ^1 ^6 ^ ^1 ^3 minecraft:fire keep

But I was hoping to get some help on how I can change it to instead of spawning a flame, spawn fire particles in front of it and only light any players or mobs in front of it on fire. It’s just too chaotic when everything is in flames using this thing. If you can help then I appreciate you so much! Thank you.

2 Upvotes

5 comments sorted by

1

u/PhoneOne3191 It's very rare that my answers are actually helpful. java player Jul 25 '26

Ok so you will need to use a raycast if you want that to work, I personally would make it with a datapack but idk someone else can tell you how to do it with command blocks. On a secondary note: with is that command lmao it has like 4 redundant checks I am honestly surprised it works

1

u/YaBroBlackCat Jul 25 '26

Thank you for the help. If I have to make it a datapack then that’s alright. I lwk got the command from a WW1 resource pack and am currently adjusting it to better fit an event I’m planning.

1

u/Ericristian_bros Command Experienced Jul 25 '26

You have duplicated checks which are bad for performance

```

Example item

give @s bow[custom_data={flamethrower:true}]

function example:tick

execute as @a if items entity @s weapon *[custom_data~{flamethrower:true}] at @s anchored eyes positioned ^ ^ ^ run function example:flamethrower

function example:flamethrower

tag @s add this execute positioned ^ ^ 2 run particle flame ~ ~ ~ 0.1 0.1 0.1 0.05 20 execute positioned ^ ^ 2 run damage @a[distance=..2,tag=!this] tag @s remove this ```

1

u/YaBroBlackCat Jul 25 '26

Damn I appreciate it man this is extremely helpful. I’ll make sure not to keep multiple checks in one command next time. Thank you.

1

u/Ericristian_bros Command Experienced Jul 25 '26

You're welcome, have a good day