diff --git a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java index a59f8424e5..013dc0a2b9 100644 --- a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java +++ b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java @@ -84,4 +84,13 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * @return True if the player has played before, otherwise false */ public boolean hasPlayedBefore(); + + /** + * Gets the Location where the player will spawn at their bed, null if they + * have not slept in one or their current bed spawn is invalid. + * + * @return Bed Spawn Location if bed exists, otherwise null. + */ + public Location getBedSpawnLocation(); + } diff --git a/paper-api/src/main/java/org/bukkit/entity/Player.java b/paper-api/src/main/java/org/bukkit/entity/Player.java index 6b35240e08..514ef14e1b 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Player.java +++ b/paper-api/src/main/java/org/bukkit/entity/Player.java @@ -470,6 +470,13 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi */ public Location getBedSpawnLocation(); + /** + * Sets the Location where the player will spawn at their bed. + * + * @param location where to set the respawn location + */ + public void setBedSpawnLocation(Location location); + /** * Determines if the Player is allowed to fly via jump key double-tap like in creative mode. * diff --git a/paper-api/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java b/paper-api/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java index 119903af9d..4bef1f02e8 100644 --- a/paper-api/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java +++ b/paper-api/src/test/java/org/bukkit/plugin/messaging/TestPlayer.java @@ -605,4 +605,8 @@ public class TestPlayer implements Player { public void setAllowFlight(boolean flight) { throw new UnsupportedOperationException("Not supported yet."); } + + public void setBedSpawnLocation(Location location) { + throw new UnsupportedOperationException("Not supported yet."); + } }