Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6834

Don't require player to be sleeping to obtain bed location

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • This server is running CraftBukkit version 3353-Spigot-dbf4938-f49e9d1 (MC: 1.18) (Implementing API version 1.18-R0.1-SNAPSHOT)
    • Yes

      Currently, the getBedLocation method on Player will throw an IllegalStateException if the player is not currently sleeping in a bed. This behavior seems strange to me because the bed location is accessible even when the player is not sleeping.

      For example, the getBedSpawnLocation method will successfully return a spawn location based on the Player's bed location. 

      The reason for this behavior is probably because a HumanEntity doesn't track a bed location, which means calling it on one that is not sleeping doesn't work. I think a better solution for this may be to return null if a HumanEntity isn't sleeping and to return the bed location if a Player isn't sleeping.

            Unassigned Unassigned
            mattrick Matthew McCune
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: