Interface BedRule

All Superinterfaces:
Wrapper

@NullMarked @AsOf("1.1.0") public interface BedRule extends Wrapper
A wrapper for bed rules in a dimensional environment.
Since:
3.0.0
  • Field Details

  • Method Details

    • canSleep

      @AsOf("1.1.0") BedRule.Rule canSleep()
      Gets the rule for sleeping in the bed.
      Returns:
      the rule for sleeping in the bed
      Since:
      1.1.0
    • canSetSpawn

      @AsOf("1.1.0") BedRule.Rule canSetSpawn()
      Gets the rule for setting the spawn point using the bed.
      Returns:
      the rule for setting the spawn point using the bed
      Since:
      1.1.0
    • explodes

      @AsOf("1.1.0") boolean explodes()
      Whether the bed explodes when used in this environment.
      Returns:
      whether the bed explodes when used in this environment
      Since:
      1.1.0
    • errorMessage

      @AsOf("1.1.0") Optional<Component> errorMessage()
      The error message displayed when a player tries to use the bed inappropriately.
      Returns:
      the error message displayed when a player tries to use the bed inappropriately, or null if no error message is set
      Since:
      1.1.0
    • toBuilder

      @AsOf("3.0.0") default BedRule.Builder toBuilder()
      Converts this BedRule to a builder.
      Returns:
      a new builder for this BedRule
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static BedRule of(BedRule.Rule canSleep, BedRule.Rule canSetSpawn, boolean explodes, @Nullable Component errorMessage)
      Creates a new BedRule instance.
      Parameters:
      canSleep - the rule for sleeping in the bed
      canSetSpawn - the rule for setting the spawn point using the bed
      explodes - whether the bed explodes when used in this environment
      errorMessage - the error message displayed when a player tries to use the bed inappropriately, or null if no error message is set
      Returns:
      a new BedRule instance
      Since:
      3.0.0
    • builder

      @AsOf("1.1.0") static BedRule.Builder builder()
      Creates a new builder for bed rules.
      Returns:
      a new builder for bed rules
      Since:
      1.1.0