Wake And Sleep (Effect) — Skript

Addon: Skript · Category: Effect · Since: 2.11

Syntax

make %livingentities% (start sleeping|[go to] sleep) [%-direction% %-location%]

Description

Make bats and foxes sleep or wake up. Make villagers sleep by providing a location of a bed. Make players sleep by providing a location of a bed. Using 'with force' will bypass "nearby monsters" ,the max distance, allowing players to sleep even if the bed is far away, and lets players sleep in the nether and end. Does not work if the location of the bed is not in the world the player is currently in. Using 'without spawn location update' will make players wake up without setting their spawn location to the bed.

Examples

make {_fox} go to sleep
make {_bat} stop sleeping
make {_villager} start sleeping at location(0, 0, 0)
make player go to sleep at location(0, 0, 0) with force
make player wake up without spawn location update

View source