TransWikia.com

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

Arqade Asked by XxDavionGamesxX on December 10, 2020

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?

One Answer

Next time, please inform us what you have already tried.

I have been working on a solution for a few hours, this question quite intrigued me. However, 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

Hope I helped - I spent a couple of hours working on this. Feel free to reply if you need anything or any changes.

Answered by Jayden on December 10, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP