diff --git a/paper-api/src/main/java/org/bukkit/entity/Villager.java b/paper-api/src/main/java/org/bukkit/entity/Villager.java index 0b96d1a045..ef48ad9b28 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Villager.java +++ b/paper-api/src/main/java/org/bukkit/entity/Villager.java @@ -2,6 +2,7 @@ package org.bukkit.entity; import java.util.Locale; import org.bukkit.Keyed; +import org.bukkit.Location; import org.bukkit.NamespacedKey; import org.jetbrains.annotations.NotNull; @@ -76,6 +77,25 @@ public interface Villager extends AbstractVillager { */ public void setVillagerExperience(int experience); + /** + * Attempts to make this villager sleep at the given location. + *
+ * The location must be in the current world and have a bed placed at the + * location. The villager will put its head on the specified block while + * sleeping. + * + * @param location the location of the bed + * @return whether the sleep was successful + */ + public boolean sleep(@NotNull Location location); + + /** + * Causes this villager to wake up if he's currently sleeping. + * + * @throws IllegalStateException if not sleeping + */ + public void wakeup(); + /** * Represents Villager type, usually corresponding to what biome they spawn * in.