Minecraft: sweepAttack particles upon attack with a diamond sword and detect direction

Minecraft: sweepAttack particles upon attack with a diamond sword and detect direction - Photo of Boys Fighting With Swords

I need some help with a cool command I'm trying to make using either 1 or multiple command blocks in 1.10. I'm trying to activate the sweepAttack particle based on the direction the player is facing upon an attack to an entity. Not only that, I'd like to make the attack look and act like a barrage of attacks hence the usage of the sweepAttack particle. So to sum up what I'm trying to make is: whenever a player attacks an entity there will be 5 individual attacks with 1 swing of a sword or any other thing in your hand along with the sweepAttack particle based off of the direction the player is facing to add a bit of realism to it. Can you help me make this possible in-game?



Best Answer

I have been unable to find a way to get it to work in 1.10.X

A solution is to use 1.13.X where they have introduced the new relative notation - the caret (^)

First, set up a scoreboard looking at minecraft.used:minecraft.diamond_sword

/scoreboard objectives add Sword minecraft.used:minecraft.diamond_sword

Next,

/execute if score @p Sword matches 1 run execute as @a at @s anchored eyes run particle minecraft:sweep_attack ^ ^ ^2 0 0 0 0.01 20 force

This looks for if the player has used a sword

Next go all of the particle command blocks (in your case, 5)

All command blocks to be chain, and conditional

/execute at @a[scores={Sword=1}] run particle minecraft:sweep_attack ^ ^ ^2 0 0 0 0.01 20 force

At the end, the last conditional chain command block

scoreboard players set @a Sword 0

cmdblock setup




Pictures about "Minecraft: sweepAttack particles upon attack with a diamond sword and detect direction"

Minecraft: sweepAttack particles upon attack with a diamond sword and detect direction - Photography of a Boy Kicking Another Boy
Minecraft: sweepAttack particles upon attack with a diamond sword and detect direction - Photo of Boys Sparring With Sword
Minecraft: sweepAttack particles upon attack with a diamond sword and detect direction - Angry Warriors Holding Weapons while Looking at the Camera





Minecraft 1.9 Snapshot: Sword Sweep Attack, Axe Shield Stun, Hoe Buffs, Weapons Tools Combat Update




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Washarapol D BinYo Jundang, Washarapol D BinYo Jundang, Washarapol D BinYo Jundang, Gioele Fazzeri