So Im currently working on a small adventure map, and Im trying to get a command block to detect if a player is on a bridge or not. Basically I want it to activate when the player is standing in the pink glass.
I know I need to do a comparator with a /testfor command, I just dont know what the datatags are that i need to use.
If it's only a case of pink glass instead of that specific location in the map, you can use /execute's "detect" function to test for a specific block at the player's location. A "Damage" value of 6 is pink glass:
/execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:stained_glass 6 /say Player is standing on pink glass.
No, the pink glass simply represents where the detection is. The player will not be standing on top of the pink glass, more so standing in it (though it wont be there at all).
Try experimenting with the parameters x,y,z, and dx,dy,dz. At one end of the bridge you have the x,y,z, and then you use the 'd' parameters to define the difference to the end of the bridge.
Rollback Post to RevisionRollBack
I have a small YouTube channel and would greatly appreciate it if you were to check me out!!
So Im currently working on a small adventure map, and Im trying to get a command block to detect if a player is on a bridge or not. Basically I want it to activate when the player is standing in the pink glass.
I know I need to do a comparator with a /testfor command, I just dont know what the datatags are that i need to use.
If it's only a case of pink glass instead of that specific location in the map, you can use /execute's "detect" function to test for a specific block at the player's location. A "Damage" value of 6 is pink glass:
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
No, the pink glass simply represents where the detection is. The player will not be standing on top of the pink glass, more so standing in it (though it wont be there at all).
Like so;
Try experimenting with the parameters x,y,z, and dx,dy,dz. At one end of the bridge you have the x,y,z, and then you use the 'd' parameters to define the difference to the end of the bridge.
I have a small YouTube channel and would greatly appreciate it if you were to check me out!!