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]

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]


Does router speed affect ping? Does router speed affect ping?

Posted On: June 11, 2023
I currently own a 150 Mbps router, and I am playing MW3 on PS3 with about 75ms to 100ms ping. Does getting a new 300 Mbps router make a big difference? Would it reduce my lag? Question from user...[More]


This is why people ship them This is why people ship them

Posted On: January 27, 2025
Question from user OCDurge at BaldursGate3 at reddit.com.Answer:At the epilogue party, Dammon writes her a letter saying he thinks about her often and basically begs her to write him back!.Answer from...[More]


How do I kill these spiders in Hogwarts Legacy? How do I kill these spiders in Hogwarts Legacy?

Posted On: August 20, 2023
I’m trying to make my way to jackdaws rest. I’m going through the forbidden forest. And these spiders I keep running into seem to be impossible to beat with my noob status. Like they keep ...[More]


Is there any way I can avoid death by FPS in Dwarf Fortress? Is there any way I can avoid death by FPS in Dwarf Fortress?

Posted On: April 14, 2023
So uh. my fort at the moment has around 106 dwarves/petitioned entertainers and 20 visitors. The problem is (and this occurred suddenly) is that the FPS has been reduced to ~4 FPS. This is unplayable ...[More]


How do I befriend Undyne? How do I befriend Undyne?

Posted On: April 17, 2024
So, I just beat undertale, and I got the neutral ending. At the end, . Flowey told me that I wasn't a good enough friend to Papyrus and Undyne. Then I talked to Papyrus, and he said Undyne wants to b...[More]


How did you guys enjoy Durge? How did you guys enjoy Durge?

Posted On: February 11, 2026
Finished my normal campaign adventure a while ago and am starting off as durge, I was pretty excited so far I was playing as a hero holding back on their urges but as I played I began to become bored,...[More]


Feel like I’m completely done with act 1, I’m an early lvl 6 Feel like I’m completely done with act 1, I’m an early lvl 6

Posted On: October 24, 2023
I’ve scoured the map. Killed everyone I think I am supposed to and ventured to all the spots, goblin camp, under dark, ancient forge, Ethel. I feel like I’ve been able to kill all enemi...[More]


Can I increase the speed of combat in XCOM? Can I increase the speed of combat in XCOM?

Posted On: June 20, 2023
XCOM Enemy Unknown is a beautiful game, but you can only see every 5 second animation so many times before it becomes repetitive and self-indulgent. Is there a way to make the animations go faster or ...[More]


How to setup Xbox Series S|X for a family? How to setup Xbox Series S|X for a family?

Posted On: March 7, 2023
I'm new to Xbox and have created an account for me and my children and have linked them to as a family. Will all members of the family be able to play if I login and setup the Xbox with my acco...[More]