How to Make Fire Punches in Minecraft (Flaming Fists)
Minecraft Java Edition 1.21+ and 26+ – Command Block Fire Punch Ability
Want to create a fire punch ability in Minecraft?
In this tutorial you will learn how to make a system where the player can set mobs on fire when punching, using Command Blocks and scoreboard damage detection.
This works in Minecraft Java Edition 1.21+ and 26+ and is perfect for RPG maps, custom skills, minigames, and adventure worlds.
Let's start by creating the firePunch scoreboard
It will be used to detect damage dealt by us
scoreboard objectives add firePunch minecraft.custom:minecraft.damage_dealt
Place 1 Repeat command block set to Always Active and enter the following command
execute as @a[scores={firePunch=1..}] at @s anchored eyes positioned ^ ^ ^1 unless data entity @s SelectedItem at @s run execute as @e[type=!player,distance=1..5,sort=nearest,limit=1] run data merge entity @s {Fire:100}
This command will detect if we dealt damage to the mob we are looking at, if we are not holding any item in the main hand, if the target is not a player, and if we are close to that mob (about 1 to 5 blocks away)
When these conditions are met, the mob will catch on fire, but we need to reset our score so it doesn't run infinitely
Place a Chain command block set to Always Active next to the Repeat command block, both facing the same direction, and use this command
scoreboard players set @a firePunch 0