I want to start an SMP (Survival Multiplayer Server) where all players cannot go downwards. Once they go upwards (jump, climb a ladder, etc.) they are unable to enter a lower y level than the one they are currently on. Each player will have a different "threshold" depending on how high they've gone. I would appreciate it if I could have the command(s) to do this sort of thing. Datapacks or plugins are acceptable as well. Thanks in advance!
Hello! Thanks for your reply although it doesn't seem to be working, although there is a likely chance that I did something wrong. I'll recount what I did to clarify my issues.
I tested this on 1.16.5 in a single-player world (to see if it would work on solely me).
I first pasted the two "Start up" commands in chat, which seemed to work and create both objectives accordingly.
I then pasted "/execute as @a[gamemode=survival] run function limity:checkheight" in a repeating and always active command block. This seemed to work as well with no errors showing in the Previous Output field.
I again placed another repeating and always active command block where I inputted the "Function limity:checkheight" command and uncapitalized the F in Function. In the Previous Output field, it stated "Unknown function limity:checkheight"
I placed another repeating and always active command block where I entered the "Execute store result score @s y.new run data get @s Pos[1] 100" command, except I uncapitalized the E in Execute and added an "entity" between "get" and "@s" because "@s Pos[1]" was showing up red and needed a filler term (see picture 1 if confused). It responded with another error in the Previous Output field that said "No entity was found".
I put "Execute at @s if score @s y.new < @s y.old run teleport @s ~ ~.01 ~" in another repeating always active command block (and I of course uncapitalized the first letter), which seemed to work since no errors were displayed in the Output field.
In the last repeating always active command block, I inputted "Execute store result score @s y.old run data get @s Pos[1] 100" (uncapitalized the E, you know the drill) and put an "entity" between the "get" and "@s" again, and it said "No entity was found" in the PO field.
TLDR/Footnote:
There were a few errors that I had to fix in the commands, and even then they didn't work. I appreciate your help although it would be nice if you could check the commands again to see what the issues were and make another post on what else I should try. After I inputted all the commands, I went into survival (since the first command block detects being in survival). If you have any issues understanding what I wrote in this or my original post, please mention that as well. If you notice my join date I am also quite new to the forums and I hope I've formatted everything correctly. I am glad you took time out of your day to help, and I hope we can get this project to a state of completion.
Picture 1:
(This applies to both "Execute store result score @s y.new run data get @s Pos[1] 100" and "Execute store result score @s y.old run data get @s Pos[1] 100")
The Meaning of Life, the Universe, and Everything.
Join Date:
9/19/2017
Posts:
57
Location:
Europe
Minecraft:
BlueRains
Discord:
BlueRains
PMC:
BlueRains
Member Details
Sorry that it didn't work, I didn't have my pc at hand to test the commands out. I do now, so I'll create the datapack and add a link *as soon as I figure it out. The problem with picture 1 is that there is a space too many, so it selects an entity with an empty name. (does not exist)
I want to start an SMP (Survival Multiplayer Server) where all players cannot go downwards. Once they go upwards (jump, climb a ladder, etc.) they are unable to enter a lower y level than the one they are currently on. Each player will have a different "threshold" depending on how high they've gone. I would appreciate it if I could have the command(s) to do this sort of thing. Datapacks or plugins are acceptable as well. Thanks in advance!
Start up:
/Scoreboard objectives add y.old dummy
/Scoreboard objectives add y.new dummy
In a repeating command block:
/execute as @a[gamemode=survival] run function limity:checkheight
Function limity:checkheight
Execute store result score @s y.new run data get @s Pos[1] 100
Execute at @s if score @s y.new < @s y.old run teleport @s ~ ~.01 ~
Execute store result score @s y.old run data get @s Pos[1] 100
This should store the y height, compare it with the old one and then store the new y height.
~Blue
Hello! Thanks for your reply although it doesn't seem to be working, although there is a likely chance that I did something wrong. I'll recount what I did to clarify my issues.
I tested this on 1.16.5 in a single-player world (to see if it would work on solely me).
I first pasted the two "Start up" commands in chat, which seemed to work and create both objectives accordingly.
I then pasted "/execute as @a[gamemode=survival] run function limity:checkheight" in a repeating and always active command block. This seemed to work as well with no errors showing in the Previous Output field.
I again placed another repeating and always active command block where I inputted the "Function limity:checkheight" command and uncapitalized the F in Function. In the Previous Output field, it stated "Unknown function limity:checkheight"
I placed another repeating and always active command block where I entered the "Execute store result score @s y.new run data get @s Pos[1] 100" command, except I uncapitalized the E in Execute and added an "entity" between "get" and "@s" because "@s Pos[1]" was showing up red and needed a filler term (see picture 1 if confused). It responded with another error in the Previous Output field that said "No entity was found".
I put "Execute at @s if score @s y.new < @s y.old run teleport @s ~ ~.01 ~" in another repeating always active command block (and I of course uncapitalized the first letter), which seemed to work since no errors were displayed in the Output field.
In the last repeating always active command block, I inputted "Execute store result score @s y.old run data get @s Pos[1] 100" (uncapitalized the E, you know the drill) and put an "entity" between the "get" and "@s" again, and it said "No entity was found" in the PO field.
TLDR/Footnote:
There were a few errors that I had to fix in the commands, and even then they didn't work. I appreciate your help although it would be nice if you could check the commands again to see what the issues were and make another post on what else I should try. After I inputted all the commands, I went into survival (since the first command block detects being in survival). If you have any issues understanding what I wrote in this or my original post, please mention that as well. If you notice my join date I am also quite new to the forums and I hope I've formatted everything correctly. I am glad you took time out of your day to help, and I hope we can get this project to a state of completion.
Picture 1:
(This applies to both "Execute store result score @s y.new run data get @s Pos[1] 100" and "Execute store result score @s y.old run data get @s Pos[1] 100")
https://ibb.co/6BYwTDr (image link)
Thanks again,
-FFPGamer
Sorry that it didn't work, I didn't have my pc at hand to test the commands out. I do now, so I'll create the datapack and add a link *as soon as I figure it out. The problem with picture 1 is that there is a space too many, so it selects an entity with an empty name. (does not exist)
Also -awesome idea and I love to help
~Blue