1

I used a command that makes particles that face a certain player, but I am not sure how to make it on one y coordinate. This is the command I was using: execute as @a[nbt={SelectedItem:{id:"minecraft:music_disc_11"}}] at @s if entity @a[distance=0.1..] facing entity player1 eyes positioned ~ ~1 ~ positioned ^ ^ ^3 run particle minecraft:dust 1.0 1.0 1.0 1.0 ~ ~ ~ 0 0 0 0 1. I am trying to figure out how to make it face the x and z of one player, player1 (I didn't want to post a real username), but then take the y of the player the particles are close to, so it doesnt point downward if the player is below me. Is there a way to do that or is that not possible?

1 Answer 1

0

I don't think it's possible directly, but you can use a dummy entity, like an invisible marker armour stand. Summon it at one player and then use a command like this one:

/execute as [dummy_entity] run data modify entity @s Pos[1] set from entity [other_player] Pos[1]

The copies the y coordinate from the NBT of the player to the NBT of the entity, therefore teleporting it to that player's height. You can then use the coordinates of that entity for your other commands and afterwards kill the dummy entity again.

7
  • Would the armor stand fall to the ground or would it float? May 21, 2020 at 22:36
  • Of course you would need to use NoGravity and all that stuff as well. I recommend the NBT tags from the first command here (but with your own tags, of course): gaming.stackexchange.com/a/369982/171580 May 22, 2020 at 0:38
  • Also, what would I put as Pos[1] and Pos[2]? Sorry I'm not very good with minecraft commands. May 22, 2020 at 1:38
  • No, Pos[2], just Pos[1] both times. It means "position of entity, entry #1", so the Y coordinate. Nothing to exchange there. You just fill in your dummy entity (tagged or named armour stand or whatever) and your other player (exact name, selector, whatever). May 22, 2020 at 7:40
  • I tried this in a command block: /execute as @s[name="player1",nbt={NoGravity:1,Invisible:1,Small:1,Invulnerable:1,Silent:1},type=armor_stand] run data modify entity @s Pos[1] set from entity username Pos[2] with the other command block like this: execute as @a[nbt={SelectedItem:{id:"minecraft:compass"}}] at @s if entity @a[distance=0.1..] facing entity @s[name="player1",nbt={NoGravity:1,Invisible:1,Small:1,Invulnerable:1,Silent:1},type=armor_stand] eyes positioned ~ ~1 ~ positioned ^ ^ ^3 run particle minecraft:dust 1.0 1.0 1.0 1.0 ~ ~ ~ 0 0 0 0 1 and it isn't working May 22, 2020 at 15:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .