Not sure if I titled that right or not, but what I'm trying to create is this:
An artificial flying system.
The most successful thing I've got working so far is say, something that allows you to roam around at y=5, but not go up or down. I'm not allowing players to go up, but I've got a crouching thing in mind which teleports players down at a certain speed when they are crouching. < This is not what I want to know.
What I need is: Rather than, say doing /execute at @a run tp @a[sort=nearest,limit=1] ~ 5 ~, I don't want to have to have a certain Y coordinate. I want them to be teleported to a particular one (not a number) that keeps them at that limit until they crouch, which then teleports them down...
I'm sure there are several ways to go about this, maybe copying the Y coordinate from another entity or something, but not really sure at the moment.
Hope I explained that clearly (I probably didn't!).
Thanks in advance!
Rollback Post to RevisionRollBack
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Not sure if I titled that right or not, but what I'm trying to create is this:
An artificial flying system.
The most successful thing I've got working so far is say, something that allows you to roam around at y=5, but not go up or down. I'm not allowing players to go up, but I've got a crouching thing in mind which teleports players down at a certain speed when they are crouching. < This is not what I want to know.
What I need is: Rather than, say doing /execute at @a run tp @a[sort=nearest,limit=1] ~ 5 ~, I don't want to have to have a certain Y coordinate. I want them to be teleported to a particular one (not a number) that keeps them at that limit until they crouch, which then teleports them down...
I'm sure there are several ways to go about this, maybe copying the Y coordinate from another entity or something, but not really sure at the moment.
Hope I explained that clearly (I probably didn't!).
Thanks in advance!
You can always specify the region.
/execute as @a at @s if entity @s[y=5,dy=-5] run teleport @s ~ ~0.5 ~
/execute as @a at @s if entity @s[y=15,dy=240] run teleport @s ~ ~-0.5 ~
Something like this might work. It's better if you actually get what I'm doing.
/execute as @a at @s if entity @s[y=5,dy=-5] run teleport @s ~ ~0.5 ~
/execute as @a at @s if entity @s[y=15,dy=240] run teleport @s ~ ~-0.5 ~
Something like this might work. It's better if you actually get what I'm doing.
What I'm trying to do is not teleport them back up, but keep them at whatever Y coordinate they are at until they crouch, which'll teleport them down slowly. From what I think this looks like, you're teleporting players up if they're below 0, and down if they're above 255...
What I'm trying to do is not teleport them back up, but keep them at whatever Y coordinate they are at until they crouch, which'll teleport them down slowly. From what I think this looks like, you're teleporting players up if they're below 0, and down if they're above 255...
Or is this doing something else?
If you can't fly up, it's not flying. It's either floating or gliding. : p
So if that's the case, are you saying that you'll fly straight like
and they stay at this height until somebody crouches to lower the height?
Also, you need to tell me/us how you glide. Cuz if it's levitation lvl 255, you know you can't take damage.
In your custom scoreboard (assuming you copied something up there ^^) When you crouch, connect it to a command that slowly brings you down. As for staying in the same height, it'll be pretty impossible to do without tags.
Using something like this /execute as @a[tag=fly] at @a run tp @s ~ 5 ~ will keep you up in that same level. And using the crouch detection above, it can be wired into another tag which will remove that fly tag and effect that person with slow falling until they stop crouching. The main problem with this is once that person stops crouching he will fall...
If you really want the person to stay, once they stop crouching you'll have to account for everyspace they stop at and use a scoreboard score to keep them there until they crouch again.
No idea if this is possible, but I had something in mind like: teleporting an armor stand with no gravity to a certain coordinates, teleporting the player to the Y coordinate of that armor stand, and making the armor stand go down when the player crouches, while still allowing the player to move along the X and Z.
Is this possible AT ALL?
Rollback Post to RevisionRollBack
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
No idea if this is possible, but I had something in mind like: teleporting an armor stand with no gravity to a certain coordinates, teleporting the player to the Y coordinate of that armor stand, and making the armor stand go down when the player crouches, while still allowing the player to move along the X and Z.
Is this possible AT ALL?
Yes that is possible. So basically tag the person to tp to the armor stand. When the person crouches, the tag will be removed and instead the armor stand travels with the player, when the play stands upright, it reverts tags, So yes it might work theoretically ofc
No idea if this is possible, but I had something in mind like: teleporting an armor stand with no gravity to a certain coordinates, teleporting the player to the Y coordinate of that armor stand, and making the armor stand go down when the player crouches, while still allowing the player to move along the X and Z.
Is this possible AT ALL?
Yes indeed, all hail /execute store.
Something like:
/execute as @e[tag=a] at @s store result entity @s Pos[0] double 1 run data get entity @p[tag=b] Pos[0]
/execute as @e[tag=a] at @s store result entity @s Pos[2] double 1 run data get entity @p[tag=b] Pos[2]
<Whatever you wanna do with sneak detection and teleporting the armor stand down>
/execute as @a[tag=b] run teleport @s @e[limit=1,sort=nearest,tag=a]
Okay. So what i've figured out from the first two is that they copy my x and z coordinates (with a slight offset) and teleport the armor stand to that.
Then, the third one teleports me to the armor stand...
Does that mean I could flip around one of the other ones for the Y coordinate to teleport ME to the Y coordinate of the armor stand?
Okay. So what i've figured out from the first two is that they copy my x and z coordinates (with a slight offset) and teleport the armor stand to that.
Then, the third one teleports me to the armor stand...
Does that mean I could flip around one of the other ones for the Y coordinate to teleport ME to the Y coordinate of the armor stand?
I'm not good at explaining, so I'll just say what my command does, see if it makes sense.
First, the 2 /execute store commands makes so that the armor stand copies the x and z coordinates of the player. Its y-coordinate stays the same.
Second, the 4th command (if u count crouching as the 3rd) makes the player teleport to the armor stand. This time, the player's y-coordinate copies the armor stand.
In other words (aka i.e. (lol)), the x & z coordinate of the armor stand follows the player's, while the y-coordinate of the player follows the armor stand.
Does that clear any doubts?
(PS: I haven't tested any of these, bear in mind it might not work.)
Okay. So I've tested it, and the first two work excellently, but the third (not including the crouch) that makes me stay at its Y coordinates just teleports me there. It doesn't just do the Y coordinate, but teleports me to the armor stand. (It was quite a conundrum getting out of that!). \
What I'm wondering is, the first two appear to copy my X and Z coordinates and apply them to the armor stand. Could I not reverse this, and copy the armor stand's Y coordinate and copy it to me?
Rollback Post to RevisionRollBack
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
1) Okay. So I've tested it, and the first two work excellently, but the third (not including the crouch) that makes me stay at its Y coordinates just teleports me there. It doesn't just do the Y coordinate, but teleports me to the armor stand. (It was quite a conundrum getting out of that!). \
2) What I'm wondering is, the first two appear to copy my X and Z coordinates and apply them to the armor stand. Could I not reverse this, and copy the armor stand's Y coordinate and copy it to me?
I'll split your comment into 2 parts.
1) Does it mean as soon as it's activated, you're stuck there? (btw, sorry bout that. Now you know that u can just untag the armor stand or simply /kill it)
2) You cannot use /execute store on players. But you can always make another armor stand and make the player teleport. Though I doubt it'll solve the issue.
Edit: I also did a little testing. I'd like to ask, how are you gonna make the player float? Levitation? Slow Fall? A block below? Elytra? I'd like to know cuz it's crucial to make the solution.
1) Does it mean as soon as it's activated, you're stuck there? (btw, sorry bout that. Now you know that u can just untag the armor stand or simply /kill it)
2) You cannot use /execute store on players. But you can always make another armor stand and make the player teleport. Though I doubt it'll solve the issue.
1. Nah it was fine to get rid of. I just wasn't expecting it.
2. :(. I guess I"ll have to think of something else. Thx though for it all :).
EDIT: The only real thing I wanted to do was make anyone wearing a certain helmet (I've got the selector part handled) stay at a certain Y coordinate.
I've got everything else for the moment, will play around with other solutions and come back if I need anything else...
Thanks for the help guys! (Altho it's not really solved...)
1. Nah it was fine to get rid of. I just wasn't expecting it.
2. :(. I guess I"ll have to think of something else. Thx though for it all :).
EDIT: The only real thing I wanted to do was make anyone wearing a certain helmet (I've got the selector part handled) stay at a certain Y coordinate.
I've got everything else for the moment, will play around with other solutions and come back if I need anything else...
Thanks for the help guys! (Altho it's not really solved...)
Wait, if all you need is to stay at the same y-coord, doesn't levitation lvl 255 solve the case? If you don't like the fact that taking damage makes the players shoot right up, you can do the following:
1. Don't let them take damage.
2. summon the same armor stand before hand. Except you do the following:
a) The armor stand simply teleports to the player
If the player takes damage (nbt=!{HurtTime:0s}), stop teleporting the armor stand to the player. Instead, make a command to do the reverse (i.e. player teleports to the armor stand). It might make the player go a little bit higher, but better than not.
c) If the player is still moving up after his/her/its HurtTime reaches 0, change it into some sort of cooldown system, where players cannot move for like 3 seconds if they take damage.
Wait, if all you need is to stay at the same y-coord, doesn't levitation lvl 255 solve the case? If you don't like the fact that taking damage makes the players shoot right up, you can do the following:
1. Don't let them take damage.
2. summon the same armor stand before hand. Except you do the following:
a) The armor stand simply teleports to the player
If the player takes damage (nbt=!{HurtTime:0s}), stop teleporting the armor stand to the player. Instead, make a command to do the reverse (i.e. player teleports to the armor stand). It might make the player go a little bit higher, but better than not.
c) If the player is still moving up after his/her/its HurtTime reaches 0, change it into some sort of cooldown system, where players cannot move for like 3 seconds if they take damage.
Now does that shed any light?
That looks pretty good! I'll try it when I can!
Rollback Post to RevisionRollBack
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Not sure if I titled that right or not, but what I'm trying to create is this:
An artificial flying system.
The most successful thing I've got working so far is say, something that allows you to roam around at y=5, but not go up or down. I'm not allowing players to go up, but I've got a crouching thing in mind which teleports players down at a certain speed when they are crouching. < This is not what I want to know.
What I need is: Rather than, say doing /execute at @a run tp @a[sort=nearest,limit=1] ~ 5 ~, I don't want to have to have a certain Y coordinate. I want them to be teleported to a particular one (not a number) that keeps them at that limit until they crouch, which then teleports them down...
I'm sure there are several ways to go about this, maybe copying the Y coordinate from another entity or something, but not really sure at the moment.
Hope I explained that clearly (I probably didn't!).
Thanks in advance!
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
You can always specify the region.
/execute as @a at @s if entity @s[y=5,dy=-5] run teleport @s ~ ~0.5 ~
/execute as @a at @s if entity @s[y=15,dy=240] run teleport @s ~ ~-0.5 ~
Something like this might work. It's better if you actually get what I'm doing.
What I'm trying to do is not teleport them back up, but keep them at whatever Y coordinate they are at until they crouch, which'll teleport them down slowly. From what I think this looks like, you're teleporting players up if they're below 0, and down if they're above 255...
Or is this doing something else?
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
If you can't fly up, it's not flying. It's either floating or gliding. : p
So if that's the case, are you saying that you'll fly straight like
and they stay at this height until somebody crouches to lower the height?
Also, you need to tell me/us how you glide. Cuz if it's levitation lvl 255, you know you can't take damage.
First off, you need crouch detection: https://www.minecraftforum.net/forums/minecraft-java-edition/redstone-discussion-and/commands-command-blocks-and/2919135-crouch-detection-in-minecraft-1-13
In your custom scoreboard (assuming you copied something up there ^^) When you crouch, connect it to a command that slowly brings you down. As for staying in the same height, it'll be pretty impossible to do without tags.
Using something like this /execute as @a[tag=fly] at @a run tp @s ~ 5 ~ will keep you up in that same level. And using the crouch detection above, it can be wired into another tag which will remove that fly tag and effect that person with slow falling until they stop crouching. The main problem with this is once that person stops crouching he will fall...
If you really want the person to stay, once they stop crouching you'll have to account for everyspace they stop at and use a scoreboard score to keep them there until they crouch again.
No idea if this is possible, but I had something in mind like: teleporting an armor stand with no gravity to a certain coordinates, teleporting the player to the Y coordinate of that armor stand, and making the armor stand go down when the player crouches, while still allowing the player to move along the X and Z.
Is this possible AT ALL?
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Yes that is possible. So basically tag the person to tp to the armor stand. When the person crouches, the tag will be removed and instead the armor stand travels with the player, when the play stands upright, it reverts tags, So yes it might work theoretically ofc
Yes indeed, all hail /execute store.
Something like:
/execute as @e[tag=a] at @s store result entity @s Pos[0] double 1 run data get entity @p[tag=b] Pos[0]
/execute as @e[tag=a] at @s store result entity @s Pos[2] double 1 run data get entity @p[tag=b] Pos[2]
<Whatever you wanna do with sneak detection and teleporting the armor stand down>
/execute as @a[tag=b] run teleport @s @e[limit=1,sort=nearest,tag=a]
Does this sound promising to you?
Okay. So what i've figured out from the first two is that they copy my x and z coordinates (with a slight offset) and teleport the armor stand to that.
Then, the third one teleports me to the armor stand...
Does that mean I could flip around one of the other ones for the Y coordinate to teleport ME to the Y coordinate of the armor stand?
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
I'm not good at explaining, so I'll just say what my command does, see if it makes sense.
First, the 2 /execute store commands makes so that the armor stand copies the x and z coordinates of the player. Its y-coordinate stays the same.
Second, the 4th command (if u count crouching as the 3rd) makes the player teleport to the armor stand. This time, the player's y-coordinate copies the armor stand.
In other words (aka i.e. (lol)), the x & z coordinate of the armor stand follows the player's, while the y-coordinate of the player follows the armor stand.
Does that clear any doubts?
(PS: I haven't tested any of these, bear in mind it might not work.)
Okay. So I've tested it, and the first two work excellently, but the third (not including the crouch) that makes me stay at its Y coordinates just teleports me there. It doesn't just do the Y coordinate, but teleports me to the armor stand. (It was quite a conundrum getting out of that!). \
What I'm wondering is, the first two appear to copy my X and Z coordinates and apply them to the armor stand. Could I not reverse this, and copy the armor stand's Y coordinate and copy it to me?
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
I'll split your comment into 2 parts.
1) Does it mean as soon as it's activated, you're stuck there? (btw, sorry bout that. Now you know that u can just untag the armor stand or simply /kill it)
2) You cannot use /execute store on players. But you can always make another armor stand and make the player teleport. Though I doubt it'll solve the issue.
Edit: I also did a little testing. I'd like to ask, how are you gonna make the player float? Levitation? Slow Fall? A block below? Elytra? I'd like to know cuz it's crucial to make the solution.
1. Nah it was fine to get rid of. I just wasn't expecting it.
2. :(. I guess I"ll have to think of something else. Thx though for it all :).
EDIT: The only real thing I wanted to do was make anyone wearing a certain helmet (I've got the selector part handled) stay at a certain Y coordinate.
I've got everything else for the moment, will play around with other solutions and come back if I need anything else...
Thanks for the help guys! (Altho it's not really solved...)
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Wait, if all you need is to stay at the same y-coord, doesn't levitation lvl 255 solve the case? If you don't like the fact that taking damage makes the players shoot right up, you can do the following:
1. Don't let them take damage.
2. summon the same armor stand before hand. Except you do the following:
a) The armor stand simply teleports to the player
If the player takes damage (nbt=!{HurtTime:0s}), stop teleporting the armor stand to the player. Instead, make a command to do the reverse (i.e. player teleports to the armor stand). It might make the player go a little bit higher, but better than not.
c) If the player is still moving up after his/her/its HurtTime reaches 0, change it into some sort of cooldown system, where players cannot move for like 3 seconds if they take damage.
Now does that shed any light?
That looks pretty good! I'll try it when I can!
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.