When you want to start the trail of particles, use this command, with X
, Y
and Z
being the coordinates of the center:
/summon ArmorStand X Y Z {Invisible:1,CustomName:"orb"}
Run these commands, in order, on a repeating/chain command block loop like the depicted:
/execute @e[type=ArmorStand,name=orb] ~ ~ ~ summon ArmorStand ~1 ~ ~ {Invisible:1}
/execute @e[type=ArmorStand,name=orb] ~ ~ ~ summon ArmorStand ~-1 ~ ~ {Invisible:1}
/execute @e[type=ArmorStand,name=orb] ~ ~ ~ summon ArmorStand ~ ~1 ~ {Invisible:1}
/execute @e[type=ArmorStand,name=orb] ~ ~ ~ summon ArmorStand ~ ~-1 ~ {Invisible:1}
/execute @e[type=ArmorStand,name=orb] ~ ~ ~ summon ArmorStand ~ ~ ~1 {Invisible:1}
/execute @e[type=ArmorStand,name=orb] ~ ~ ~ summon ArmorStand ~ ~ ~-1 {Invisible:1}
/kill @e[type=ArmorStand,name=orb]
/execute @e[type=MushroomCow,name=Mushy,c=1] ~ ~ ~ entitydata @e[type=ArmorStand,c=1] {CustomName:"orb"}
/kill @e[type=ArmorStand,name=!orb]
/execute @e[type=ArmorStand,name=orb] ~ ~ ~ /particle cloud ~ ~ ~ 0 0 0 0.02 3
/execute @e[type=MushroomCow,name=Mushy,c=1] ~ ~ ~ kill @e[type=ArmorStand,r=1]
A screenshot:
It has been brought to my attention that this method is rather slow. A way to speed it up is simply to make another set of command blocks as below:
I have tested both the functionality and the speedup method and they seem to work. However, if you try it and find a problem, please tell me and I will look into it.
If this is possible, the player who fired the arrow, either by UUID or by username, should be stored somewhere for each arrow.
First I checked the wiki for an arrow entity's NBT data. But as you said, while ThrownEnderpearl
, ThrownExpBottle
, ThrownPotion
, and Snowball
all have an ownerName
field, Arrow
does seem to have anything indicating it would store the player who fired it.
I fired an arrow and checked its NBT in game, as I've noticed the wiki occasionally misses out data tags:
But again there was nothing that stored my player ID. (Note that UUIDMost and UUIDLeast are both for identifying the entity itself, not who fired it)
I wanted to see if the data of who shot an arrow persists through the world closing and opening. To do this, I:
- Created a world
- Shot an arrow straight up
- Closed the world
- Opened the world
- Quickly opened the world to LAN
- Logged in with an account that was on survival, positioned directly below the arrow
When the arrow hit the survival player, not only was no ping sound played for hitting a player, but the message in chat simply showed that the player was shot by "Arrow", rather than me:
(Note that both players were logged on, the one that shot the arrow and the one that got hit by it)
Because of this, I believe that the player who fired an arrow is not actually stored anywhere in an arrow's data.
Thus the answer to "Is there any way to summon arrows that are shot by a player or mob?" unfortunately seems to simply be no.
I suspect death messages and ping sounds are done temporarily in code, rather than stored anywhere that can be manipulated with commands. They are lost when the world reloads, and are not stored anywhere in the individual arrow's data.
Best Answer
/summon MushroomCow ~ ~ ~ {ActiveEffects:[{id:14,Duration:100000,Amplifier:1,HideParticles:1}],Riding:{id:"Spider",Attributes:[{Name:"generic.maxHealth",Base:10000}],Riding:{id:"Villager",Attributes:[{Name:"generic.maxHealth",Base:10000}],Riding:{id:"Spider",Attributes:[{Name:"generic.maxHealth",Base:10000}],Riding:{id:"Bat",Attributes:[{Name:"generic.maxHealth",Base:10000}]}}}}}
Explanation:
I used a spider to separate the mobs in the end as it's exactly 1 block tall. It is invulnerable to suffocation (because it has like 10000 health).
Also, all mobs have 10000 health, so even when they are stuck in a block because of the bat, they don't die. Change health by changing the number of
baseHealth
in this section:Attributes:[{Name:"generic.maxHealth",Base:<HP>}]
To kill the whole stack, first off, you have to make sure all commands blocks are activated at the very same time -- exact same time, or it may result in idling totems of mob towers. Then type in the command
/kill @e[type=Bat,c=1,r=<size of the field>]
in command blockA
,/kill @e[type=Villager,c=1,r=<size of the field>]
inB
,/kill @e[type=Mooshroom,c=1,r=<size of the field>]
inC
and/kill @e[type=Spider,c=2,r=<size of the field>]
inD
. Then you should be able to kill the whole stack.I don't have a computer now so I cannot check the code, but feel free to tell me if it worked or not. Thanks!