• 0

    posted a message on 1.9: 1 Player Sleeping
    Quote from Vindicar»

    Thank you for your replies, I have already reverse-engineered this myself.

    I'm using time add 200, and this doesn't seem to skip past sunrise much.

    So my recipe (for the sake of those who will come to this thread later) is like this:


    1. Preparation.
    2. Create new scoreboard objective, not linked to any statistic (a dummy). I'll call mine Sleep, but you can change the name.
      Command: /scoreboard objectives add Sleep dummy
      Disable command block output in chat, because it will be spammy: /gamerule commandBlockOutput false
      You also might want to disable it in the server logs: /gamerule logAdminCommands false
    3. Choose a safe place, maybe somewhere in bedrock layer, and create a command block. Set it on Repeat, Unconditional, Always Active.
    4. This command block will be increasing Sleep score by 1 every tick for all players(@a) in bed (have NBT tag Sleeping = 1).
      Command for the command block: scoreboard players add @a Sleep 1 {Sleeping:1b}
    5. Place another command block, so one from step 2 would be pointing into it (that's called chaining). Set it on Chain, Conditional, Always Active.
    6. This command block will be checking if any player (@a) has Sleep score at least 120. Since 1 game tick is 1/20th of a second, player will reach Sleep score 120 after 6 seconds - while it takes only 5 seconds to sleep normally.
      Command for the block: scoreboard players test @a Sleep 120
    7. Chain another command block after the one from step 3. Set it on Chain, Conditional, Always Active.
    8. This command block will be advancing server time every tick there is a player with sufficient Sleep score. If command from step 3 failed (no such player yet), it won't run. The more you add, the faster the time will advance. Once the sun rises, the game will kick you out of the bed.
      Command for the block: time add 200
    9. Normally, that would be enough, but there is another thing to consider: thunderstorms. You can sleep during thunderstorms, and advancing server time won't clear them out any quicker, potentially leading to server fastforwarding several in-game weeks.
    10. So create another command block, chained after one from step 4: Chain, Unonditional, Always Active.
      It will be similar to step 3, except you will need a larger Sleep score to test for. The bigger value you test for, the longer it will take for the contraption to register that player has stayed in bed for too long. As before, 1 second is 20 game ticks.
      Command for the block: scoreboard players test @a Sleep 180
    11. And another chained command block, set to Chain, Conditional, Always Active.
    12. This one will set the weather to rain instead of thunderstorm, causing the game to kick you out of the bed. The rain duration is in seconds, however you can omit it to get random duration.
      Command for the block: weather rain 30
    13. Now, create a command block NOT chained to the previous ones. Set it to Repeat, Unconditional, Always Active.
    14. This one will nullify Sleep score for any player(@a) NOT in bed (having NBT tag Sleeping = 0).
      Command for the block: scoreboard players set @a Sleep 0 {Sleeping:0b}
      This one os the most spammy, as it will be running constantly when all players are ouf ot the bed, flooding the server log with messages.

    As you can see, this one doesn't announce that a player is sleeping. It's kinda enough for me, but I guess it'd be possible with some additional circuitry.

    My idea is following:

    if you find a player with Sleep objective set exactly to 1 (by means of scoreboard players test @a Sleep 1 1), use /tellraw command to say that someone is sleeping. It will only match a player on the very first tick of the sleep, so the message won't be repeated until the player gets out of the bed and their Sleep score is nullified.


    Why does the command for step 7 need to be separate from the others? If it's unconditional it won't be affected by the other commands running.
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Space Purge Adventure Map

    Here's the first video of my series in this map. My friend played it with me and we loved it. I am uploading one episode every other day.

    (yeah I'm really bad with intros, just started making youtube videos and haven't gotten the hang of it)

    Posted in: Maps
  • 0

    posted a message on Minecraft server crashes when exploring map

    I can't tell of this was the problem but it looks like under System Details that you are running your server with only a maximum of 1 Gigabyte. If you have more RAM on your computer you should definitely try allocating more to it by changing the JVM arguments. Also, in my experience with servers, making -Xms and -Xmx the same value works better.


    As well as that under System Details it says that you are running Minecraft Version 1.8.4, not 1.8.7. But that might not be a huge problem because the only things really changed in 1.8.4 to 1.8.7 are security issues with servers.

    Posted in: Server Support and Administration
  • 0

    posted a message on [1.8.9] Planetary Confinement - The Dunes (A.K.A. Vanilla Crash Landing) V 1.4 [OVER 120,000 DOWNLOADS!]

    I understand that to make the sieve work I need java 8. The dilemma I have is that I am hosting my world on a MineOS server (and yes, I know that a fair amount of people have never heard of that) and I can't just run an installer for java. If someone can tell me how I might do that or at least find a page that tells you how (I've tried searching it on google, nothing helpful comes up) that would be awesome. :-)


    And if I don't even have to install it on the server side it's just a client thing and I'm being REALLY stupid by assuming that then that information would be very helpful. :-)

    Posted in: Maps
  • 0

    posted a message on [1.8.9] Planetary Confinement - The Dunes (A.K.A. Vanilla Crash Landing) V 1.4 [OVER 120,000 DOWNLOADS!]

    The sieve isn't giving me anything. I am using 1.8.3 and I have even tried making a new one. I am playing this on a server with 1 other person if that makes any difference. I can confirm though that I am using the server version of the map. If you can help me, that would be most helpful. :)

    Posted in: Maps
  • To post a comment, please .