4

Ok, basically, I can't run mods too well on my computer and would prefer using command blocks. There is a mod I want to semi replicate where on a random night, it will tell the player "This is not a normal Night...", and if the player tries to sleep, they will sleep for a second then be forced out of their bed, where some over powered zombies will spawn. I know how to spawn the zombies and how to test if the player is sleeping, but apart from killing them I don't know how to remove them from their bed.

2
  • You could try breaking and replacing (cloning back) the bed. (But that only works if the beds are in predefined locations)
    – aytimothy
    Oct 24, 2015 at 10:14
  • I guess I could, and it is only for me when im online, so it wouldnt be too hard. How would I do that though? I dont have an extensive knowledge of command blocks. Also, how would I get the rotation correct? Oct 24, 2015 at 10:16

3 Answers 3

4

You don't actually have to kill the player to push him out of his bed. All you need to do is damage him.

/effect @p 19 2

That will deal half a heart of damage to the player, by poisoning him briefly, in order to wake him up.

3
  • Thanks! Going to try it now, this seems like the best idea for what I want :) Oct 25, 2015 at 10:52
  • Ok. Just tested it. That was simple and easy. Thank you, this had me stumped xD Oct 25, 2015 at 10:54
  • Only just realised how to. Done it now though :) is there a way to mark the whole question as answered? Oct 25, 2015 at 13:09
1

As of Minecraft 1.13.1, it is now possible to simply /tp the player to be not touching the bed, whereupon they will stop sleeping.

-2

Ok maybe this will work do /testfor (Name) at the x y z of the bed and use a comparator and connect one to an another commandblock and do /say this is not (Name) and the bed will disappear you can make it disappear by adding another command block and use /setblock x y z air then add two repeaters and delay it to its maximum and add another command block and use /setblock x y z bed and your done hope this worked

5
  • You might want to improve your answer a bit, for example by using punctuation, or less intimidating grammar.
    – Lars
    Oct 24, 2015 at 14:11
  • what do you mean? Oct 24, 2015 at 14:13
  • @The_Dark_One They mean that your answer is very hard to read; it's all one sentence without any kind of punctuation.
    – SirBenet
    Oct 24, 2015 at 15:39
  • i already knew he told me that earlier Oct 25, 2015 at 4:31
  • Punctuation is not optional. It is a requirement.
    – Frank
    Oct 25, 2015 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .