Class BedRule.Builder
java.lang.Object
dev.wyck.environment.BedRule.Builder
- Enclosing interface:
BedRule
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the BedRule instance.canSetSpawn(BedRule.Rule canSetSpawn) Sets the rule for setting the spawn point using the bed.canSleep(BedRule.Rule canSleep) Sets the rule for sleeping in the bed.destroyOnLeave(boolean destroyOnLeave) Sets whether the bed is destroyed when a player leaves it.destroyOnUse(boolean destroyOnUse) Sets whether the bed is destroyed when used in this environment.errorMessage(@Nullable Component errorMessage) Sets the error message displayed when a player tries to use the bed inappropriately.
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
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
-
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
-
destroyOnUse
Sets whether the bed is destroyed when used in this environment.- Parameters:
destroyOnUse- whether the bed is destroyed on use- Returns:
- this builder, for chaining
- Since:
- 4.0.0
-
destroyOnLeave
Sets whether the bed is destroyed when a player leaves it.- Parameters:
destroyOnLeave- whether the bed is destroyed on leave- Returns:
- this builder, for chaining
- Since:
- 4.0.0
-
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
-