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.
-
You could try breaking and replacing (cloning back) the bed. (But that only works if the beds are in predefined locations)– aytimothyCommented 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?– goldenlord52Commented Oct 24, 2015 at 10:16
3 Answers
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.
-
Thanks! Going to try it now, this seems like the best idea for what I want :) Commented Oct 25, 2015 at 10:52
-
Ok. Just tested it. That was simple and easy. Thank you, this had me stumped xD Commented 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? Commented Oct 25, 2015 at 13:09
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.
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
-
You might want to improve your answer a bit, for example by using punctuation, or less intimidating grammar.– LarsCommented Oct 24, 2015 at 14:11
-
-
@The_Dark_One They mean that your answer is very hard to read; it's all one sentence without any kind of punctuation.– SirBenetCommented Oct 24, 2015 at 15:39
-
-