• 0

    posted a message on (SOLVED) How exactly does custom.leave_game work?

    Also, I imagine both these would be repeating sequences I would activate during the game?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on (SOLVED) How exactly does custom.leave_game work?
    Quote from YMbrothers»

    Both are easy to accomplish.


    1:

    /scoreboard players set @e[name=PlayersInSpleefGame] PlayersInSpleef 0

    /execute as @a[scores={InSpleefGame=1..}] run scoreboard players add @e[name=PlayersInSpleefGame] PlayersInSpleef 1

    /execute if entity @e[scores={PlayersInSpleef=1}] run ...


    2:

    /scoreboard players set @e[name=PlayersInSpleefGame] PlayersInSpleef 0

    /execute as @a[scores={InSpleefGame=1..}] run scoreboard players add @e[name=PlayersInSpleefGame] PlayersInSpleef 1


    Yep, unexpected, right? That's rly it.

    Btw, you're still stuck at the player counting system of the spleef game? Need help?


    Thanks for that. Didn't expect it to be so easy.


    No, I'm not just stuck at that, I kinda was using a different method, I just hadn't gotten around to working with players 'leaving' the game yet. I've got the 'joining' the lobby, activating a countdown when 2+ players, canceling the countdown if someone leaves, starting the game after 60 seconds, starting a 5 minute countdown, got the 'death' working, where a player falls out of the game, got victory working (when only 1 player left), and just working on some things like the reset system. Have yet to do the 'draw' system, when the 5 minute timer reaches zero.


    Also, I don't get to work on this that much, only Fridays and Saturdays, so yeah...

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on (SOLVED) How exactly does custom.leave_game work?

    Hm... so how would I do this exactly? (A player counting system). I've looked up a bit about it, and most of it seems to be just finding how many players are in the world.


    What I want is (because not all players may be in the spleef game) is to either, 1. Find when only one player with InSpleefGame=1 exists, or, 2. When a player leaves the game, it removes a score of 1 (PlayersInSpleef) from an armor stand called PlayersInSpleefGame.


    The second option, at least at the moment, appears to be either impossible, or much harder than the first.


    So, how would I accomplish this first one?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on (SOLVED) How exactly does custom.leave_game work?

    I am currently using this score to make 'welcome back' messages to my minigame world, plus doing a whole heap of score removal and tping them. But I want to know how it works exactly.


    This is because, in the Spleef minigame I'm working on, I have an armour stand that records the amount of players playing. This allows it to do things such as, when it only has 1 score, the victorious player is chosen, when it has score of 2, the game begins, and so on.


    But, what I'm trying to do, is make it so that if someone quits mid-game, it recognises that (using the custom.leave_game) and removes a score from the entity.


    Is it possible to use this? Or must I find another method?


    If so, I would love it if someone could provide some ideas for me on how to achieve this.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [Help] Check if a player has a certain amount of deaths

    Have you tried using the criteria type 'deathCount'? I think it works in the same way as 'minecraft.custom:minecraft.deaths.'


    That's what works for me...

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame

    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.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame

    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).

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame

    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.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame

    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!

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame
    Quote from YMbrothers»

    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).

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Custom Bows Data Pack

    This is the kind of thing I want to get into doing eventually, but at the moment I'm working on something else...


    They are awesome.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame

    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?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame

    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.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame

    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.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Creating a Spleef Minigame

    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!

    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.