Interface BedRuleResult


@Experimental public sealed interface BedRuleResult
Represents the result of a bed rule during PlayerBedEnterEvent and PlayerBedFailEnterEvent. Bed rules are responsible for allowing players to sleep and to set their spawn point
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BedRuleResult
    Used when the bed rule is allowed
    static final BedRuleResult
    Used when the bed rule is set to always be denied
    static final BedRuleResult
    Used when the bed rule is denied due to there being too much light.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this result is a success
  • Field Details

    • ALLOWED

      static final BedRuleResult ALLOWED
      Used when the bed rule is allowed
    • TOO_MUCH_LIGHT

      static final BedRuleResult TOO_MUCH_LIGHT
      Used when the bed rule is denied due to there being too much light. This is the case during daytime without thunderstorms
    • NEVER

      static final BedRuleResult NEVER
      Used when the bed rule is set to always be denied
  • Method Details

    • success

      boolean success()
      Returns true if this result is a success
      Returns:
      whether this result is a success