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

Extensions for PlayerBedEnterEvent

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • git-Spigot-6b015b4-26c8927 (MC: 1.13.1) (Implementing API version 1.13.1-R0.1-SNAPSHOT)
    • Yes

      There are several conditions which might prevent a player from entering a bed / going to sleep. It might be useful for plugins to be able to bypass some of those conditions (assuming they don't cause consistency problems with clients or other server components).

      The currently existing PlayerBedEnterEvent only allows cancelling the event.

      There seem to be the following conditions (assuming the bed isn't occupied already and the player isn't sleeping or dead):

      • World doesn't allow sleeping. (maybe allowing sleeping in the nether and end might be possible?)
      • Not night or thunderstorm currently. (allowing entering bed regardless of that possible?)
      • Monsters nearby (possibility to ignore specific entities).
      • Bed too far away. (not sure whether this makes sense to include)
      • Event cancelled: Preventing bed entering even if all other conditions are fulfilled.

      Usecase: Currently I am mostly interested in letting minecraft ignore specific entities (plugin spawned NPC mobs) when checking for nearby monsters.

      But maybe some of those other conditions might make sense to be included as well.

            Unassigned Unassigned
            blablubbabc blablubbabc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: