mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
SPIGOT-5180: Add Villager#sleep() and #wakeup() methods
By: LelouBil <bilel.jahid@gmail.com>
This commit is contained in:
parent
63ec9ca6be
commit
17034cc249
@ -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.
|
||||
* <br>
|
||||
* 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.
|
||||
|
Loading…
Reference in New Issue
Block a user