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 is it and where can I find or take those holopics in Gamedec? What is it and where can I find or take those holopics in Gamedec?

Posted On: February 17, 2023
During the Knight's Code mission, there is a faulty NPC that you have to fix or kill. If you try to expose her, she will give you a job. You have to collect those two holopics. I have sea...[More]


Does how the ghost look like can give you the answer as to what it is? Does how the ghost look like can give you the answer as to what it is?

Posted On: October 15, 2023
When you can see the ghost, is the model used a good way to know what ghost you are dealing with, or are the models unrelated to the current ghost? Question from user Fredy31 at stackexchange. A...[More]


The real reason we don't have Quidditch in Hogwarts Legacy The real reason we don't have Quidditch in Hogwarts Legacy

Posted On: April 18, 2023
Question from user erwin4200 at HogwartsLegacyGaming at reddit.com. Answer: Why adding it to the game as DLC if you can squeeze out money with a separate full triple a release. Answer from us...[More]


Rocket League controller only works on Press Any Button to Start screen Rocket League controller only works on Press Any Button to Start screen

Posted On: September 17, 2023
When I start Rocket League, I press a button on my controller at the screen that says "Press Any Button to Start". That brings up the main menu, but my controller no longer works to control ...[More]


Change installation path of Minecraft Launcher? (Not the game) Change installation path of Minecraft Launcher? (Not the game)

Posted On: June 22, 2023
When downloading and installing the minecraft launcher from the offical website, there is no step for me to choose the install path and its always in C:XboxGames. Anyway for me to change the path into...[More]


How do I prioritize local hydrogen over remote hydrogen from a gas giant? How do I prioritize local hydrogen over remote hydrogen from a gas giant?

Posted On: January 13, 2023
I recently exploited my local gas giant for hydrogen and fire ice, which is quite useful. The main reason was to get started on deuterium production for various advanced items. But I just noticed that...[More]


How to get past this old man in Leaf green? How to get past this old man in Leaf green?

Posted On: March 17, 2024
It's been a while since I last played Pokémon Leaf green.I am playing it with my nephew and he asked me how to get to first gym(Brock's gym to get boulder badge.).Here is the problem:.An old man is l...[More]


How does durability work in Breath of the Wild? How does durability work in Breath of the Wild?

Posted On: January 15, 2023
In the tool tips, the game always says to "keep an eye on your durability" or that certain actions might "knock off some durability", but so far I have only seen 3 stages of durabi...[More]


BG3 Mod Path to Menzoberranzan demo aims for Nautiloid size BG3 Mod Path to Menzoberranzan demo aims for Nautiloid size

Posted On: March 23, 2026
Question from user Wargulf at BaldursGate3 at reddit.com.Answer:This looks so cool .Answer from user Snoo-28829 at BaldursGate3 at reddit.com....[More]


Can you die from an Unknown Location in Slay The Spire? Can you die from an Unknown Location in Slay The Spire?

Posted On: December 17, 2023
I encountered an Unknown Location (aka a ? room) with an option to upgrade 2 cards but would make me lose 16 HP. I encountered this room while I only had 1 hp. If I had taken the upgrade, would the ro...[More]