[SOLVED] (If you want to know exactly how, please comment and I'll explain what I did in the end.)
Using slowness does not seem to work and setting blocks beside the player is very difficult even using 1.13 execute commands. It is simple to make but not simple to clean up. Let me start with some context though.
I'm currently trying to make a system quite like Breath of the Wild, where when the player pulls out a bow while falling more than three blocks above the ground, the fall slows and everything goes into bullet time. I've already accomplished giving the player anti-levitation, giving slowness to the mobs near the player, and finally making sure the thing only turns on when there are 3 air blocks below the player, but I can't seem to figure out how to keep the player from moving on the x and z coordinates. Allowing them to move too much on the x and z coordinates makes the bow-draw very cheaty if the player jumps off a ledge, allowing them almost elytra-like movement until they reach near the ground. I hope someone can help me with this, and as you know, I am using 1.13, so if you are going to show a command I should use, please keep the syntax correctly. Or don't, honestly, I need all the help I can get.
What do you mean what you are using to levitate? I am using the levitation status effect but set to a value of 254 so instead of levitating, it simply slows the fall of the player. I've tried filling barrier blocks around the player but deleting them is a hassle because the player is in a constant state of motion. If you have another idea with barrier blocks, it would be much appreciated though.
So you couldn't use some execute commands to place barrier blocks around your current plane and then have another execute command that deletes all the barrier blocks above you as you fall?
In theory, I could do this, but that would require constant removal of all barrier blocks when the player is not holding the bow more than a couple blocks above the ground. Another problem is that if they player tries to shoot something, they can't because of the blocks in front of them.
I dont have access to /scoreboard but I was thinking if there was something you could make a leash out of? Like spawn an invisible falling armorstand that only lets you go out a couple blocks from it?
Perhaps it is in the middle of a 5x5 space if a player exits that box it teleports them either back to or 1 block closer to the armor stand.
going off of drhubs, it might be best to spawn the armorstand and constantly teleport the player to it - giving it the same levitation effect of course, and setting it to a marker so it won't affect bow shots
So I would have an armorstand teleport to the player whenever they are in the air with a bow and then keep the armorstand there until the requirements are not followed. How would I teleport the player to the x and z coordinates of the armorstand and not the y coordinates though? I really wish variables existed. That would make things easy; simply /tp @p [armorstand x] ~0 [armorstand z], but those two values can't work, can they?
EDIT: Did some stuff. Herky-jerky movement. Still working.
So I would have an armorstand teleport to the player whenever they are in the air with a bow and then keep the armorstand there until the requirements are not followed. How would I teleport the player to the x and z coordinates of the armorstand and not the y coordinates though? I really wish variables existed. That would make things easy; simply /tp @p [armorstand x] ~0 [armorstand z], but those two values can't work, can they?
EDIT: I think I can do this with fancy executes. Is there a way to teleport the player to the closest @e[tpye=armor_stand,name=bowtp,tag=bow] so there can be multiplayer support?
actually, what I am saying is when the player STARTS drawing the bow, summon the armorstand at the player's position and give it the levitation effect, ect. While the bow is drawn, teleport the player to the armorstand's position. when the bow is released, kill the armorstand.
Either way, it is a good idea. I'd need to make a repeating command block that tests for the requirements, then I'd need to have a one time spawn. How would I make a one time spawn? Would summoning arrows constantly with incredibly old age work so they despawn in one tick? I think I'll try that to see if it works. I hope you have an easier way to do this though.
EDIT: Turns out, age doesn't work how it normally does in 1.13. Weird. I'll keep testing things.
I play in MC Bedrock so your syntax may be a little different. That does a 3x3 square and teleports players to the middle only on the x and z plane. You can expand out the square pretty easily.
Also I would not recommend Type if you have Tags or anything of that sort. Just because you could add more players and make sure it only teleports you to a specific entity of your naming.
I really hope that didn't take you too long to figure out, because I got to another snag. When the player is given slowfall levitation, any arrow they shoot goes straight up because glitches are weird (also, the player cannot pick anything up, but that doesn't matter). Because of this snag, I decided that doing some barrier block filling wouldn't disrupt anything and I figured out a way to make it work really well with both armorstands and barrier blocks combined.
P.S. Now I'm trying to figure out how to make a bow summon arrows in front of the barriers using command blocks. If I encounter any problems with this, should i continue posting on this thread or make a new one about that specifically?
[SOLVED] (If you want to know exactly how, please comment and I'll explain what I did in the end.)
Using slowness does not seem to work and setting blocks beside the player is very difficult even using 1.13 execute commands. It is simple to make but not simple to clean up. Let me start with some context though.
I'm currently trying to make a system quite like Breath of the Wild, where when the player pulls out a bow while falling more than three blocks above the ground, the fall slows and everything goes into bullet time. I've already accomplished giving the player anti-levitation, giving slowness to the mobs near the player, and finally making sure the thing only turns on when there are 3 air blocks below the player, but I can't seem to figure out how to keep the player from moving on the x and z coordinates. Allowing them to move too much on the x and z coordinates makes the bow-draw very cheaty if the player jumps off a ledge, allowing them almost elytra-like movement until they reach near the ground. I hope someone can help me with this, and as you know, I am using 1.13, so if you are going to show a command I should use, please keep the syntax correctly. Or don't, honestly, I need all the help I can get.
Can you by chance post what you are using to levitate? If it isnt too much? I might have an idea but not sure. You have barrier blocks right?
What do you mean what you are using to levitate? I am using the levitation status effect but set to a value of 254 so instead of levitating, it simply slows the fall of the player. I've tried filling barrier blocks around the player but deleting them is a hassle because the player is in a constant state of motion. If you have another idea with barrier blocks, it would be much appreciated though.
So you couldn't use some execute commands to place barrier blocks around your current plane and then have another execute command that deletes all the barrier blocks above you as you fall?
In theory, I could do this, but that would require constant removal of all barrier blocks when the player is not holding the bow more than a couple blocks above the ground. Another problem is that if they player tries to shoot something, they can't because of the blocks in front of them.
I dont have access to /scoreboard but I was thinking if there was something you could make a leash out of? Like spawn an invisible falling armorstand that only lets you go out a couple blocks from it?
Perhaps it is in the middle of a 5x5 space if a player exits that box it teleports them either back to or 1 block closer to the armor stand.
going off of drhubs, it might be best to spawn the armorstand and constantly teleport the player to it - giving it the same levitation effect of course, and setting it to a marker so it won't affect bow shots
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!
So I would have an armorstand teleport to the player whenever they are in the air with a bow and then keep the armorstand there until the requirements are not followed. How would I teleport the player to the x and z coordinates of the armorstand and not the y coordinates though? I really wish variables existed. That would make things easy; simply /tp @p [armorstand x] ~0 [armorstand z], but those two values can't work, can they?
EDIT: Did some stuff. Herky-jerky movement. Still working.
actually, what I am saying is when the player STARTS drawing the bow, summon the armorstand at the player's position and give it the levitation effect, ect. While the bow is drawn, teleport the player to the armorstand's position. when the bow is released, kill the armorstand.
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!
I would go with your proposal but I have no idea how to test for the bow being drawn. Is there a way to do this?
sorry, I meant when they have the bow out.
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!
Either way, it is a good idea. I'd need to make a repeating command block that tests for the requirements, then I'd need to have a one time spawn. How would I make a one time spawn? Would summoning arrows constantly with incredibly old age work so they despawn in one tick? I think I'll try that to see if it works. I hope you have an easier way to do this though.
EDIT: Turns out, age doesn't work how it normally does in 1.13. Weird. I'll keep testing things.
I am trying out an execute command for you to see if it might work. I will update you with my results.
****UPDATE****
/execute @e[type=armor_stand] ~+1~~+1 teleport @e[type=player,dx=-2,dz=-2] ~-1 ~ ~-1
/execute @e[type=armor_stand] ~-1~~-1 teleport @e[type=player,dx=2,dz=2] ~+1 ~ ~+1
I play in MC Bedrock so your syntax may be a little different. That does a 3x3 square and teleports players to the middle only on the x and z plane. You can expand out the square pretty easily.
Also I would not recommend Type if you have Tags or anything of that sort. Just because you could add more players and make sure it only teleports you to a specific entity of your naming.
I really hope that didn't take you too long to figure out, because I got to another snag. When the player is given slowfall levitation, any arrow they shoot goes straight up because glitches are weird (also, the player cannot pick anything up, but that doesn't matter). Because of this snag, I decided that doing some barrier block filling wouldn't disrupt anything and I figured out a way to make it work really well with both armorstands and barrier blocks combined.
P.S. Now I'm trying to figure out how to make a bow summon arrows in front of the barriers using command blocks. If I encounter any problems with this, should i continue posting on this thread or make a new one about that specifically?
It's kind of part of the same issue I guess. You are still trying to get a complete optimized slow fall function.
No it didn't. I had it kind of in my head already and actually needed to learn that for a game I have anyways. dx,dy,and dz functions are very useful.
**Edit**
So how are you going about doing levitation or the slow fall currently or going to?
I did /effect levitation and just had me constantly teleported to a command block and it worked.
If I knew how you were going about it there I could probably be more help.