How do I make it so that a command only runs when Im at a certain position

[BACK]
How do I make it so that a command only runs when Im at a certain position
Posted On: February 14, 2023

I'm trying to make it so that if someone goes to a certain coordinate, it will trigger a boss fight.


I have a chain of commands set up to do this, but it can only activate when I pull a lever. I want to make it so that the chain is only run if the player is at the coordinates, but for some reason the following doesn't work as expected:.


/execute if entity @a[x=-519.5,y=141,z=-258.5] run . 


The command I put after run just runs even if I'm not at the specified coordinates. Does anyone know how to make this work? I looked up how /execute works but I actually can't understand why this isn't working.


Question from user VeryHotClara at gaming.stackexchange.com.


Answer:

The issue is that with your selector, you're only moving the starting point at which the selector starts looking for players, and you didn't actually limit the area it'll search in.


For that you can either use distance (to create a spherical selection, based on feet position) or dx/dy/dz (to create a cuboid selection based on hitbox overlap).


In your case, assuming you want to know when a player is inside the block you mention, your selector should look like this:.


@a[x=-519.0,y=141.0,z=-258.0,dx=0,dy=0,dz=0].


Read more about target selectors here: https://minecraft.fandom.com/wiki/Target_selectors.


Answer from user Plagiatus at gaming.stackexchange.com.



[BACK]
How do I make it so that a command only runs when Im at a certain position
Posted On: February 14, 2023

I'm trying to make it so that if someone goes to a certain coordinate, it will trigger a boss fight.


I have a chain of commands set up to do this, but it can only activate when I pull a lever. I want to make it so that the chain is only run if the player is at the coordinates, but for some reason the following doesn't work as expected:.


/execute if entity @a[x=-519.5,y=141,z=-258.5] run . 


The command I put after run just runs even if I'm not at the specified coordinates. Does anyone know how to make this work? I looked up how /execute works but I actually can't understand why this isn't working.


Question from user VeryHotClara at gaming.stackexchange.com.


Answer:

The issue is that with your selector, you're only moving the starting point at which the selector starts looking for players, and you didn't actually limit the area it'll search in.


For that you can either use distance (to create a spherical selection, based on feet position) or dx/dy/dz (to create a cuboid selection based on hitbox overlap).


In your case, assuming you want to know when a player is inside the block you mention, your selector should look like this:.


@a[x=-519.0,y=141.0,z=-258.0,dx=0,dy=0,dz=0].


Read more about target selectors here: https://minecraft.fandom.com/wiki/Target_selectors.


Answer from user Plagiatus at gaming.stackexchange.com.



[BACK]

What are those icons in the top left of the Rain World hibernation screen? What are those icons in the top left of the Rain World hibernation screen?

Posted On: April 17, 2023
As the title says: what are those icons in the top left corner? Question from user Fritz at gaming.stackexchange.com. Answer: You killed some creatures during this life. The crossed bones and...[More]


Regarding the You didnt need it anyway achievement Regarding the You didnt need it anyway achievement

Posted On: July 28, 2023
In the game Antimatter Dimensions, there is an achievement called "You didn't need it anyway", which is achievable when you: Infinity without having any 8th Antimatter Dimensions. Acc...[More]


is there a way to auto-join conversations in multiplayer Baldurs Gate 3? is there a way to auto-join conversations in multiplayer Baldurs Gate 3?

Posted On: September 23, 2023
When playing multiplayer in Baldur's Gate 3, is there any way to automatically join conversations initiated by another player? Or alternatively, can I add some sort of audio cue when there's a...[More]


How do you evolve trade Pokémon on Lets Go Pikachu - Eevee? How do you evolve trade Pokémon on Lets Go Pikachu - Eevee?

Posted On: April 28, 2024
I would like to know how to evolve Pokémon via trade, such as Machoke into Machamp on Let's Go Pikachu/Eevee.Currently, I have 2 Nintendo Switches, a digital copy of both games on the same Nintendo l...[More]


Are there any merchants in Legend of Grimrock 2? Are there any merchants in Legend of Grimrock 2?

Posted On: June 13, 2023
Are there any merchants in Legend of Grimrock 2? I want to know if I should hoard items or just drop the ones that I don't need. I assume it's the same as the first but I want to make sure. ...[More]


Sona-Taric League Of Legends bot lane in Season 9 Sona-Taric League Of Legends bot lane in Season 9

Posted On: May 11, 2023
At the time of writing, the combination of Sona and Taric is extremely powerful in pro play. What is the reasoning and strategy behind professional League teams taking both Sona and Taric bot lane?...[More]


Are the Draugr apologizing to me? Are the Draugr apologizing to me?

Posted On: February 4, 2015
Draugr sometimes say "Unstaad Krosis" when attacking. I understand that means "many apologies" in dragon tongue (convo with Paarthurnax). .Does this hint that they are doing something against their wi...[More]


Why can't I catch a Thestral in Hogwarts Legacy? Why can't I catch a Thestral in Hogwarts Legacy?

Posted On: March 5, 2023
I cannot for the life of me seem to catch a thestral. Any tips? Question from user Own_Doctor9472 at HogwartsLegacyGaming at reddit.com. Answer: I just use leviosa and then the nab sack. Neve...[More]


How do I check where to go next? How do I check where to go next?

Posted On: June 15, 2023
I've just started playing FF7 again after a near 1-year hiatus. That said, my save file contains a fair bit amount of playthrough already, so I have no desire to restart, but I can't figure ou...[More]


Is there a bobble head equivalent in Fallout: New Vegas? Is there a bobble head equivalent in Fallout: New Vegas?

Posted On: August 24, 2023
I have been looking around for the standard stat boosters and skill boosters and still haven't seen anything that will boost my S.P.E.C.I.A.L. I was wondering if there are any things hidden away l...[More]