-
Notifications
You must be signed in to change notification settings - Fork 73
Developer API
BetterSleeping v3 comes equipped with a developer API. This API is used internally to give players their (non) sleeping (de)buffs. Currently only a single event is available but more may be added later.
This is easiest when working on a Maven project. Simply add the following dependency to your pom.xml. It is advised to always use the latest version, check the available versions here.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.Nuytemans-Dieter</groupId>
<artifactId>BetterSleeping</artifactId>
<version>v3.0.6</version>
</dependency>
For non-Maven projects, please refer to your IDE's documentation on how to include a jar file.
BetterSleeping will fire TimeSetToDayEvent
whenever the time changes to day for any reason.
This event has several methods:
This returns the Cause
of time being set to day.
Possible causes are:
-
NATURAL
: When it becomes morning in a world without interference of other plugins. -
SLEEPING
: When the time is set to day by BetterSleeping due to sleeping players. -
OTHER
: Any other cause, probably other plugins setting the time to day or using the/time set
command.
Simply returns the World
in which the time was set to day.
Returns a List
that contains all players that slept.
Returns a List
that contains all players in this world that did not sleep.
BetterSleeping v4: Commands | Sleeping settings | Bypass permissions | Buffs | Dev API (see Spigot)
BetterSleeping v3: Commands | Config | Sleeping settings | Bypass permissions | Buffs | Dev API
BetterSleeping v2: Commands and permissions | Configuration | PlaceholderAPI