Class BedRule.Builder

java.lang.Object
dev.wyck.wrapper.environment.BedRule.Builder
Enclosing interface:
BedRule

@AsOf("1.1.0") public static final class BedRule.Builder extends Object
A builder for bed rules. Defaults to Minecraft overworld rules.
Since:
1.1.0
  • Constructor Details

    • Builder

      public Builder()
    • Builder

      public Builder(BedRule bedRule)
  • Method Details

    • setCanSleep

      @AsOf("1.1.0") public BedRule.Builder setCanSleep(BedRule.Rule canSleep)
      Sets the rule for sleeping in the bed.
      Parameters:
      canSleep - the rule for sleeping in the bed
      Returns:
      this builder, for chaining
      Since:
      1.1.0
    • setCanSetSpawn

      @AsOf("1.1.0") public BedRule.Builder setCanSetSpawn(BedRule.Rule canSetSpawn)
      Sets the rule for setting the spawn point using the bed.
      Parameters:
      canSetSpawn - the rule for setting the spawn point using the bed
      Returns:
      this builder, for chaining
      Since:
      1.1.0
    • setExplodes

      @AsOf("1.1.0") public BedRule.Builder setExplodes(boolean explodes)
      Sets whether the bed explodes when used in this environment.
      Parameters:
      explodes - whether the bed explodes when used in this environment
      Returns:
      this builder, for chaining
      Since:
      1.1.0
    • setErrorMessage

      @AsOf("1.1.0") public BedRule.Builder setErrorMessage(@Nullable Component errorMessage)
      Sets the error message displayed when a player tries to use the bed inappropriately.
      Parameters:
      errorMessage - the error message displayed when a player tries to use the bed inappropriately, or null to remove the error message
      Returns:
      this builder, for chaining
      Since:
      1.1.0
    • build

      @AsOf("1.1.0") public BedRule build()
      Builds the BedRule instance.
      Returns:
      the BedRule instance
      Since:
      1.1.0