So, I'm working on a Minigame world, and at the moment I'm creating spleef as a game. But the commands are getting a little difficult, so I need some help.
(NOTE: I will be working this out myself, but it'll take a lot longer than if I just ask for help)
This isn't just going to be the basis for spleef games, but for (hopefully) all games.
So, what I have to so far is this: Someone gets given a JoinedSpleef score of 1 when they walk into the portal, which then triggers a whole heap of stuff (Giving an armour stand called PlayersInGame a score to record how many players are in the game, gives the player a score of InSpleefGame, teleports them, and removes the JoinedSpleef score).
What I want is this, for the whole thing more or less.
When two or more players are in the waiting lobby, a 60 second countdown starts. If everyone leaves (or one player left), it stops and resets. When the timer reaches zero, the game starts.
Another countdown starts, so that the games can't go for too long.
When players fall through the floor, they are given another score, which sets them on spectator and eliminates them.
When either the timer runs out, or only one player is left standing, another chain is triggered, announcing the winner and teleporting everyone else back.
NOTE: I have an armour stand which keeps track of how many players are in the game, so that will be used for starting the starting countdown, cancelling it, beginning the game, and ending it...
This might be too much for someone to do, but while I can, I'll put it out there.
Thanks in advance! (Hopefully)
If I haven't made enough sense, or explained stuff enough, please tell me and I will attempt to do so!
would it be more convenient if you just score the player itself and not create an armor stand that will be the one to be scored? more entities in the world mean more memory to run and store by the game.
1. Just as LRMC0C1 implied, armor stands aren't really needed. That's true unless there's other purpose of the armor stand and you're not telling us. You can use a fake player in the scoreboard. For example, /execute ... run scoreboard players add x <any scoreboard> 1. You can always use /execute if to check the score of fake players.
2. You know how to make countdowns right...
3. OK SC*cough*rew that.
what makes you find it a little difficult?
Or do you just want us to create what you requested?
I have a timer, counting down from 60 seconds to 0.
The armor stand called 'Time' begins with a 'Second' score of 60, and every second, it takes away 1.
While this is happening, I have a command block chain that is spamming itself (sort of), executing at the entity called 'Time', so that when the armor stand has a score of 60, it says 'A spleef game will begin in 60 seconds', '30 seconds', and so on down to 1.
Well, it works, sort of, but when Time has a score of, say, 15, it will say
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
Until the timer ticks down to 14 seconds.
So, if anyone needs to know this, the command block chain looks like this.
Redstone Block
Impulse Command Block, with the execute at armor stand called 'Time' with score of 60.
Chain Command Block, with same command, except 30,
More Chain Command blocks, with the same commands.
Chain Command Block, with setblock air at the bottom, so that it resets.
The problem is clearly in the last block, but I don't know how to fix this...
Thanks in advance.
Rollback Post to RevisionRollBack
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
I have a timer, counting down from 60 seconds to 0.
The armor stand called 'Time' begins with a 'Second' score of 60, and every second, it takes away 1.
While this is happening, I have a command block chain that is spamming itself (sort of), executing at the entity called 'Time', so that when the armor stand has a score of 60, it says 'A spleef game will begin in 60 seconds', '30 seconds', and so on down to 1.
Well, it works, sort of, but when Time has a score of, say, 15, it will say
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
Until the timer ticks down to 14 seconds.
So, if anyone needs to know this, the command block chain looks like this.
Redstone Block
Impulse Command Block, with the execute at armor stand called 'Time' with score of 60.
Chain Command Block, with same command, except 30,
More Chain Command blocks, with the same commands.
Chain Command Block, with setblock air at the bottom, so that it resets.
The problem is clearly in the last block, but I don't know how to fix this...
Thanks in advance.
Lemme see... All the chains are fine expect the 15 second command?
I assume your command chin looks something like this:
1I: /execute if entity @e[name=Time,scores={Second=60}] run tellraw @a "The game will begin in 60 seconds"
2C: /execute if entity @e[name=Time,scores={Second=30}] run tellraw @a "The game will begin in 30 seconds"
3C: /execute if entity @e[name=Time,scores={Second=15}] run tellraw @a "The game will begin in 15 seconds"
(and so on...)
If that's the case, here's the question:
1. Which command causes the /setblock to happen?
2. Mind if you show the original command (you can replace the names for not spoiling the game) so I can see where it goes wrong?
Well, actually the only part that's different for each command is the /execute, and you got that exactly right.
I don't really think I need to show the commands, because they're exactly like what you've got, except, rather than saying, 60 seconds, 30 seconds, and so on, I just got lazy and added an 'objective' in there that just stated 'The game will begin in (Seconds Score) seconds'.
So, it goes like,
/execute at entity @e[name=Time,scores={Seconds=60}] run tellraw @a "The game will begin in (Seconds score) seconds".
/execute at entity @e[name=Time,scores={Seconds=30}] run tellraw @a "The game will begin in (Seconds score) seconds".
/execute at entity @e[name=Time,scores={Seconds=15}] run tellraw @a "The game will begin in (Seconds score) seconds".
Perhaps the problem is in the 'at'? Should I be using 'if'?
No, it isn't just the 15 seconds command, it's all of them.
The countdown command, if you're not sure, is counting down (obviously)... 50, 49, 48, 47, and so on, switching every 10 or so ticks.
The setblock command is just at the top of the chain of blocks, so after all the tellraw commands, it simply says /setblock ~ ~-10 ~ minecraft:air
I don't care about showing the commands, it's just that I'm not at my normal PC at the moment, so I can't get them up...
I'll be checking this more-or-less frequently, so if you need more info, please tell me.
EDIT 1: It's not so much these commands I need help with (well, that's it for the moment), but the basis I'm thinking of is: how can I get these commands to constantly be activating in a chain, or attempting to, but once each activates successfully, make it stop activating?
That's why it's spamming the tellraw command. Because, for a whole second, the Seconds score is on 15, and while it's on 15, the tellraw command that says 'the game begins in 15 seconds' is spamming itself until the score counts down to 14. Then it stops....
Well, actually the only part that's different for each command is the /execute, and you got that exactly right.
I don't really think I need to show the commands, because they're exactly like what you've got, except, rather than saying, 60 seconds, 30 seconds, and so on, I just got lazy and added an 'objective' in there that just stated 'The game will begin in (Seconds Score) seconds'.
So, it goes like,
/execute at entity @e[name=Time,scores={Seconds=60}] run tellraw @a "The game will begin in (Seconds score) seconds".
/execute at entity @e[name=Time,scores={Seconds=30}] run tellraw @a "The game will begin in (Seconds score) seconds".
/execute at entity @e[name=Time,scores={Seconds=15}] run tellraw @a "The game will begin in (Seconds score) seconds".
Perhaps the problem is in the 'at'? Should I be using 'if'?
No, it isn't just the 15 seconds command, it's all of them.
The countdown command, if you're not sure, is counting down (obviously)... 50, 49, 48, 47, and so on, switching every 10 or so ticks.
The setblock command is just at the top of the chain of blocks, so after all the tellraw commands, it simply says /setblock ~ ~-10 ~ minecraft:air
I don't care about showing the commands, it's just that I'm not at my normal PC at the moment, so I can't get them up...
I'll be checking this more-or-less frequently, so if you need more info, please tell me.
EDIT 1: It's not so much these commands I need help with (well, that's it for the moment), but the basis I'm thinking of is: how can I get these commands to constantly be activating in a chain, or attempting to, but once each activates successfully, make it stop activating?
That's why it's spamming the tellraw command. Because, for a whole second, the Seconds score is on 15, and while it's on 15, the tellraw command that says 'the game begins in 15 seconds' is spamming itself until the score counts down to 14. Then it stops....
That may help?
Aha, I think I got the issue.
The /tellraw command should be spamming like 19-20 times every second?
You should see where I'm going. It's running every tick.
So, 1 second has 20 ticks, the command runs every tick. That's where the spam message comes from.
To fix it, add another scoreboard detection, so it'll be something like this:
Another issue I have, which I sort of talked about in the previous question...
Is there a way of making a command only activate once? This is for when the countdown for the start of the game is cancelled.
WHAT HAPPENS:
I have this in a repeating command block:
/execute at @e[name=PlayersInSpleefGame,scores={PlayersInSpleef=..1}] run setblock 2009 101 1939 minecraft:redstone_block
If that activates (meaning that there is less than 2 people waiting for the game to start, thus cancelling the countdown) the redstone block activates a chain like this:
Impulse: /setblock 2008 101 1949 minecraft:redstone_block (this restarts the checking for more than 1 player waiting for game to start, thus starting the countdown).
Chain (Always Active): /scoreboard players set @e[name=Time] SpleefTimerStart 0 (This stops the countdown)
Now. The problem is, when this chain activates, it manages to say the 'Game Cancelled' twice. This, I think, is because the command block that activates the chain isn't stopped quick enough. I've tried everything I know, but it ain't working...
So, like I said above, I would really, as a whole, like to know (if it's poss) how to make it so that the chain is constantly spamming itself, but once it works successfully, then it stops instantly, meaning it'll only happen once.
(I'll probably have figured out a way by the time someone replies, but I'll tell you if I do).
Thanks in advance!
Rollback Post to RevisionRollBack
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Another issue I have, which I sort of talked about in the previous question...
Is there a way of making a command only activate once? This is for when the countdown for the start of the game is cancelled.
WHAT HAPPENS:
I have this in a repeating command block:
/execute at @e[name=PlayersInSpleefGame,scores={PlayersInSpleef=..1}] run setblock 2009 101 1939 minecraft:redstone_block
If that activates (meaning that there is less than 2 people waiting for the game to start, thus cancelling the countdown) the redstone block activates a chain like this:
Impulse: /setblock 2008 101 1949 minecraft:redstone_block (this restarts the checking for more than 1 player waiting for game to start, thus starting the countdown).
Chain (Always Active): /scoreboard players set @e[name=Time] SpleefTimerStart 0 (This stops the countdown)
Now. The problem is, when this chain activates, it manages to say the 'Game Cancelled' twice. This, I think, is because the command block that activates the chain isn't stopped quick enough. I've tried everything I know, but it ain't working...
So, like I said above, I would really, as a whole, like to know (if it's poss) how to make it so that the chain is constantly spamming itself, but once it works successfully, then it stops instantly, meaning it'll only happen once.
(I'll probably have figured out a way by the time someone replies, but I'll tell you if I do).
Thanks in advance!
Before anything, 3 things:
1. What's the command that makes the redstone block at 2009 101 1939 replaced by something else, so that you can re-activate it? Most importantly, where is it?
2. Try to put an impulse command block next to the redstone block at 2009 101 1939. Simply put something like /say hi. Check if it also runs twice.
3. Which command resets the PlayersInSpleef score? Most importantly, where is the command.
Yeah... I guess that should be enough information to gather.
1. The command that resets the redstone block at 2009 101 1939 is at the end of the command block chain, and it's setblock 2009 101 1939 air
2. Yes, it does run twice.
3. That might be the issue, because really, there isn't one. When a player enters the spleef arena, an armor stand gets a PlayersInSpleef score of 1 added. When the score is above 1 (2 or more) It starts the countdown. When the score is less than 2 (1 or less) (well, that trigger only starts when the countdown does) It cancels it.
The score only goes down when someone leaves the game.
When a player falls below y=98, (They fall through the floor) it gives them a score of SpleefDeath 1.
I'm having trouble, however, making it work.
If, for example, I have /execute at @a[y=0,dy=98] run say hi, in a repeating, always active command block, it doesn't do it, no matter what.
If I have, just /execute at @a[y=98] run say hi it spams it.
I've tried using execute as, execute if, execute at, and so on, but the commands ONLY work if I execute it, not the command block. (That is, I press t, copy the command in, and press enter).
Rollback Post to RevisionRollBack
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
This almost works, but not quite. (I just had to make the @a[dy=68] @a[dy=.68]) ... Which I don't know why. I suppose it makes it less than. I just wish that they kept with the theme of using .. for less than or greater than.
Rollback Post to RevisionRollBack
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
1. The command that resets the redstone block at 2009 101 1939 is at the end of the command block chain, and it's setblock 2009 101 1939 air
2. Yes, it does run twice.
3. That might be the issue, because really, there isn't one. When a player enters the spleef arena, an armor stand gets a PlayersInSpleef score of 1 added. When the score is above 1 (2 or more) It starts the countdown. When the score is less than 2 (1 or less) (well, that trigger only starts when the countdown does) It cancels it.
The score only goes down when someone leaves the game.
This might be a little abstract, but get this:
This is the command you used to set the redstone block:
/execute at @e[name=PlayersInSpleefGame,scores={PlayersInSpleef=..1}] run setblock 2009 101 1939 minecraft:redstone_block
In this condition, this is the factor that decides whether it should run or not:
scores={PlayersInSpleef=..1}
What does this mean? It means as soon as this condition is true, it'll just repeatedly place the redstone block (/setblock ... replace makes to where it only sets the block if the existing one is a different block).
And how is this related? Easy. At the end of the chain, you tried to set the redstone block to air, but then the block immediately changes back to redstone block cuz the condition is still True.
Hence, to fix it, you need to add extra conditions/commands that will make the condition false in the same chain and before the /setblock ... air.
e.g. In the same chain, right before /setblock 2009 101 1939 air, add something like /scoreboard players set @e[name=PlayersInSpleefGame] PlayersInSpleef 0. In addition, change the condition to this: @e[name=PlayersInSpleefGame,scores={PlayersInSpleef=1}]. This might make to where the game can start with 0 player, but you can prevent that in other places.
*exhales* *drinks orange juice* *more exhales* I hope you get what I mean, and also my mindset.
So, I'm working on a Minigame world, and at the moment I'm creating spleef as a game. But the commands are getting a little difficult, so I need some help.
(NOTE: I will be working this out myself, but it'll take a lot longer than if I just ask for help)
This isn't just going to be the basis for spleef games, but for (hopefully) all games.
So, what I have to so far is this: Someone gets given a JoinedSpleef score of 1 when they walk into the portal, which then triggers a whole heap of stuff (Giving an armour stand called PlayersInGame a score to record how many players are in the game, gives the player a score of InSpleefGame, teleports them, and removes the JoinedSpleef score).
What I want is this, for the whole thing more or less.
When two or more players are in the waiting lobby, a 60 second countdown starts. If everyone leaves (or one player left), it stops and resets. When the timer reaches zero, the game starts.
Another countdown starts, so that the games can't go for too long.
When players fall through the floor, they are given another score, which sets them on spectator and eliminates them.
When either the timer runs out, or only one player is left standing, another chain is triggered, announcing the winner and teleporting everyone else back.
NOTE: I have an armour stand which keeps track of how many players are in the game, so that will be used for starting the starting countdown, cancelling it, beginning the game, and ending it...
This might be too much for someone to do, but while I can, I'll put it out there.
Thanks in advance! (Hopefully)
If I haven't made enough sense, or explained stuff enough, please tell me and I will attempt to do so!
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
I have command experience. Would you like me to join the world and help you 1 on 1? Otherwise I can try my best to post something here as a solution.
would it be more convenient if you just score the player itself and not create an armor stand that will be the one to be scored? more entities in the world mean more memory to run and store by the game.
Hmmm....
1. Just as LRMC0C1 implied, armor stands aren't really needed. That's true unless there's other purpose of the armor stand and you're not telling us. You can use a fake player in the scoreboard. For example, /execute ... run scoreboard players add x <any scoreboard> 1. You can always use /execute if to check the score of fake players.
2. You know how to make countdowns right...
3. OK SC*cough*rew that.
what makes you find it a little difficult?
Or do you just want us to create what you requested?
I think that for now, I'm fine working it out. However, if I run into any SPECIFIC problems, I will post them on here.
Thanks for the help (or the offer of it), guys.
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Okay, so my first issue is this:
I have a timer, counting down from 60 seconds to 0.
The armor stand called 'Time' begins with a 'Second' score of 60, and every second, it takes away 1.
While this is happening, I have a command block chain that is spamming itself (sort of), executing at the entity called 'Time', so that when the armor stand has a score of 60, it says 'A spleef game will begin in 60 seconds', '30 seconds', and so on down to 1.
Well, it works, sort of, but when Time has a score of, say, 15, it will say
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
'The game will begin in 15 seconds'.
Until the timer ticks down to 14 seconds.
So, if anyone needs to know this, the command block chain looks like this.
Redstone Block
Impulse Command Block, with the execute at armor stand called 'Time' with score of 60.
Chain Command Block, with same command, except 30,
More Chain Command blocks, with the same commands.
Chain Command Block, with setblock air at the bottom, so that it resets.
The problem is clearly in the last block, but I don't know how to fix this...
Thanks in advance.
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Lemme see... All the chains are fine expect the 15 second command?
I assume your command chin looks something like this:
1I: /execute if entity @e[name=Time,scores={Second=60}] run tellraw @a "The game will begin in 60 seconds"
2C: /execute if entity @e[name=Time,scores={Second=30}] run tellraw @a "The game will begin in 30 seconds"
3C: /execute if entity @e[name=Time,scores={Second=15}] run tellraw @a "The game will begin in 15 seconds"
(and so on...)
If that's the case, here's the question:
1. Which command causes the /setblock to happen?
2. Mind if you show the original command (you can replace the names for not spoiling the game) so I can see where it goes wrong?
Well, actually the only part that's different for each command is the /execute, and you got that exactly right.
I don't really think I need to show the commands, because they're exactly like what you've got, except, rather than saying, 60 seconds, 30 seconds, and so on, I just got lazy and added an 'objective' in there that just stated 'The game will begin in (Seconds Score) seconds'.
So, it goes like,
/execute at entity @e[name=Time,scores={Seconds=60}] run tellraw @a "The game will begin in (Seconds score) seconds".
/execute at entity @e[name=Time,scores={Seconds=30}] run tellraw @a "The game will begin in (Seconds score) seconds".
/execute at entity @e[name=Time,scores={Seconds=15}] run tellraw @a "The game will begin in (Seconds score) seconds".
Perhaps the problem is in the 'at'? Should I be using 'if'?
No, it isn't just the 15 seconds command, it's all of them.
The countdown command, if you're not sure, is counting down (obviously)... 50, 49, 48, 47, and so on, switching every 10 or so ticks.
The setblock command is just at the top of the chain of blocks, so after all the tellraw commands, it simply says /setblock ~ ~-10 ~ minecraft:air
I don't care about showing the commands, it's just that I'm not at my normal PC at the moment, so I can't get them up...
I'll be checking this more-or-less frequently, so if you need more info, please tell me.
EDIT 1: It's not so much these commands I need help with (well, that's it for the moment), but the basis I'm thinking of is: how can I get these commands to constantly be activating in a chain, or attempting to, but once each activates successfully, make it stop activating?
That's why it's spamming the tellraw command. Because, for a whole second, the Seconds score is on 15, and while it's on 15, the tellraw command that says 'the game begins in 15 seconds' is spamming itself until the score counts down to 14. Then it stops....
That may help?
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Aha, I think I got the issue.
The /tellraw command should be spamming like 19-20 times every second?
You should see where I'm going. It's running every tick.
So, 1 second has 20 ticks, the command runs every tick. That's where the spam message comes from.
To fix it, add another scoreboard detection, so it'll be something like this:
scores={Second=30,Tick=19}
Or something similar, you get the idea...
Et workeths. Thanks, until next time... (I hope not).
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Another issue I have, which I sort of talked about in the previous question...
Is there a way of making a command only activate once? This is for when the countdown for the start of the game is cancelled.
WHAT HAPPENS:
I have this in a repeating command block:
/execute at @e[name=PlayersInSpleefGame,scores={PlayersInSpleef=..1}] run setblock 2009 101 1939 minecraft:redstone_block
If that activates (meaning that there is less than 2 people waiting for the game to start, thus cancelling the countdown) the redstone block activates a chain like this:
Impulse: /setblock 2008 101 1949 minecraft:redstone_block (this restarts the checking for more than 1 player waiting for game to start, thus starting the countdown).
Chain (Always Active): /scoreboard players set @e[name=Time] SpleefTimerStart 0 (This stops the countdown)
Chain (Always Active): /tellraw @a[scores={InSpleefGame=1}] ["",{"text":"Game Cancelled! ","bold":true},{"text":"(Not Enough Players)","color":"gray"}]
Now. The problem is, when this chain activates, it manages to say the 'Game Cancelled' twice. This, I think, is because the command block that activates the chain isn't stopped quick enough. I've tried everything I know, but it ain't working...
So, like I said above, I would really, as a whole, like to know (if it's poss) how to make it so that the chain is constantly spamming itself, but once it works successfully, then it stops instantly, meaning it'll only happen once.
(I'll probably have figured out a way by the time someone replies, but I'll tell you if I do).
Thanks in advance!
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Before anything, 3 things:
1. What's the command that makes the redstone block at 2009 101 1939 replaced by something else, so that you can re-activate it? Most importantly, where is it?
2. Try to put an impulse command block next to the redstone block at 2009 101 1939. Simply put something like /say hi. Check if it also runs twice.
3. Which command resets the PlayersInSpleef score? Most importantly, where is the command.
Yeah... I guess that should be enough information to gather.
1. The command that resets the redstone block at 2009 101 1939 is at the end of the command block chain, and it's setblock 2009 101 1939 air
2. Yes, it does run twice.
3. That might be the issue, because really, there isn't one. When a player enters the spleef arena, an armor stand gets a PlayersInSpleef score of 1 added. When the score is above 1 (2 or more) It starts the countdown. When the score is less than 2 (1 or less) (well, that trigger only starts when the countdown does) It cancels it.
The score only goes down when someone leaves the game.
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
Also, I am trying to make this:
When a player falls below y=98, (They fall through the floor) it gives them a score of SpleefDeath 1.
I'm having trouble, however, making it work.
If, for example, I have /execute at @a[y=0,dy=98] run say hi, in a repeating, always active command block, it doesn't do it, no matter what.
If I have, just /execute at @a[y=98] run say hi it spams it.
I've tried using execute as, execute if, execute at, and so on, but the commands ONLY work if I execute it, not the command block. (That is, I press t, copy the command in, and press enter).
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
/execute as @a at @s positioned ~ 97 ~ if entity @a[dy=98] run say hi
you mean like this? Only at the block between 97 and 98 will it commence?
This almost works, but not quite. (I just had to make the @a[dy=68] @a[dy=.68]) ... Which I don't know why. I suppose it makes it less than. I just wish that they kept with the theme of using .. for less than or greater than.
Please, everyone, if your post is solved, edit the name and mark it [SOLVED]. Period.
positioned X Y Z if entity @e[dx,dy,dz] that is the whole volume making the @a in as @a the center
stating dx means dx+X
stating dy means dy+Y
stating dz means dz+Z
This might be a little abstract, but get this:
This is the command you used to set the redstone block:
/execute at @e[name=PlayersInSpleefGame,scores={PlayersInSpleef=..1}] run setblock 2009 101 1939 minecraft:redstone_block
This condition causes this command to activate:
@e[name=PlayersInSpleefGame,scores={PlayersInSpleef=..1}]
In this condition, this is the factor that decides whether it should run or not:
scores={PlayersInSpleef=..1}
What does this mean? It means as soon as this condition is true, it'll just repeatedly place the redstone block (/setblock ... replace makes to where it only sets the block if the existing one is a different block).
And how is this related? Easy. At the end of the chain, you tried to set the redstone block to air, but then the block immediately changes back to redstone block cuz the condition is still True.
Hence, to fix it, you need to add extra conditions/commands that will make the condition false in the same chain and before the /setblock ... air.
e.g. In the same chain, right before /setblock 2009 101 1939 air, add something like /scoreboard players set @e[name=PlayersInSpleefGame] PlayersInSpleef 0. In addition, change the condition to this: @e[name=PlayersInSpleefGame,scores={PlayersInSpleef=1}]. This might make to where the game can start with 0 player, but you can prevent that in other places.
*exhales* *drinks orange juice* *more exhales* I hope you get what I mean, and also my mindset.
I see some misconceptions...
dx, dy, dz are actually the length of that dimention, not a 2nd pair of coordinates.
Hence, dy=1 is enough.
Or to make things simpler:
/execute as @a at @s if entity @s[y=0,dy=98] run say hi