I want 8 command blocks and each will test for the player facing a direction. I want one to test if they are facing N, one for NE, one for E, etc. I know how to do this but I am too lazy to do it. Here it is for four: /testfor @a[rym=135,ry=-135], /testfor @a[rym=-135,ry=-45], /testfor @a[rym=-45,ry=45], /testfor @a[rym=45,ry=135]. I just don't want to mess with the directions and stuff, and I'm not in a hurry. These obviously are hooked up to a fast clock, with comparators facing out. Thanks for any help in advance.
for some reason @a[rym=-60ry=-30] - positive X, positive Z isn't working for me. It is always powering the comparator, and I do have it on a fast clock
yea, i'm making a jetpack, and i want to teleport them in those specific directions when they are facing the correct way and have the jetpack on. so i ended up doing tp @a[___] ~ ~ ~. The only time execute wouldn't work is for setblock, because it would set the block relative to the player rather than the command block.
No idea why this one wouldn't work, maybe an invisible character got there somewhere, try retyping the command.
When it comes to setblock you can type in the actual coords or do double execute and seblock relative to some entity (e.x. armor stand)
But it's ok if you want to stick with testfor unless you want to make it just a bit quicker
Or just set the player's score to the direction they're facing (in objective playerDirection, let's say), and then execute commands based as that player. It'll also make it multiplayer-friendly very very easily.
No idea why this one wouldn't work, maybe an invisible character got there somewhere, try retyping the command.
When it comes to setblock you can type in the actual coords or do double execute and seblock relative to some entity (e.x. armor stand)
But it's ok if you want to stick with testfor unless you want to make it just a bit quicker
I just like using relative coordinates in case I import it into another world, but I didn't think about executing it at another entity. Normally retyping the command works, but it isn't this time. Other than that command not working, I don't need much more help. Thanks a lot for helping though.
Or just set the player's score to the direction they're facing (in objective playerDirection, let's say), and then execute commands based as that player. It'll also make it multiplayer-friendly very very easily.
If I put it on my server, i'll do that, it's a great idea. Also do you know how to make guardians target only players with a specific scoreboard score. I doubt it is currently possible, but you seem good with command blocks so...
What would that change? You can put those directly into player selector just like a score so you can use that for multiplayer too.
I replied about that on your topic, just make everyone that has a desired score join the same team as a guardian, mobs in your team shouldn't attack you.
Oh really, that's awesome thank you so much. I really wanted the guardians to only attack certain players. Thanks again.
I'm not sure why would you want to use testfor as you can put the command directly into player selector but as I have those written down already here you go:
@a[rym=-30,ry=30] - positive Z
@a[rym=-120,ry=-60] - positive X
@a[rym=150,ry=-150] - negative Z
@a[rym=60,ry=120] - negative X
@a[rym=120,ry=150] - negative X, negative Z
@a[rym=-150,ry=-120] - positive X, negative Z
@a[rym=30,ry=60] - negative X, positive Z
@a[rym=-60,ry=-30] - positive X, positive Z < for anyone copy-pasting, this line is lacking a comma between -60 and ry. I have added it here though.
yea, i'm making a jetpack, and i want to teleport them in those specific directions when they are facing the correct way and have the jetpack on. so i ended up doing tp @a[___] ~ ~ ~. The only time execute wouldn't work is for setblock, because it would set the block relative to the player rather than the command block.
Or just set the player's score to the direction they're facing (in objective playerDirection, let's say), and then execute commands based as that player. It'll also make it multiplayer-friendly very very easily.
I just like using relative coordinates in case I import it into another world, but I didn't think about executing it at another entity. Normally retyping the command works, but it isn't this time. Other than that command not working, I don't need much more help. Thanks a lot for helping though.
If I put it on my server, i'll do that, it's a great idea. Also do you know how to make guardians target only players with a specific scoreboard score. I doubt it is currently possible, but you seem good with command blocks so...
Oh really, that's awesome thank you so much. I really wanted the guardians to only attack certain players. Thanks again.
I refer back to this so often I've bookmarked it. So much easier than puzzling it out each time, thank you guys!
Also...
⠀
s̮̹̃rͭ͆̄͊̓̍ͪ͝e̮̹̜͈ͫ̓̀̋̂v̥̭̻̖̗͕̓ͫ̎ͦa̵͇ͥ͆ͣ͐w̞͎̩̻̮̏̆̈́̅͂t͕̝̼͒̂͗͂h̋̿