Interface BedRule
- All Superinterfaces:
Wrapper
A wrapper for bed rules in a dimensional environment.
- Since:
- 3.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder for bed rules.static enumAn enum representing the rules for bed usage in an environment.Nested classes/interfaces inherited from interface Wrapper
Wrapper.Context<C> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic BedRule.Builderbuilder()Creates a new builder for bed rules.Gets the rule for setting the spawn point using the bed.canSleep()Gets the rule for sleeping in the bed.The error message displayed when a player tries to use the bed inappropriately.booleanexplodes()Whether the bed explodes when used in this environment.static BedRuleof(BedRule.Rule canSleep, BedRule.Rule canSetSpawn, boolean explodes, @Nullable Component errorMessage) Creates a new BedRule instance.default BedRule.BuilderConverts this BedRule to a builder.Methods inherited from interface Wrapper
asHandle, toMinecraft
-
Field Details
-
WIRE
-
-
Method Details
-
canSleep
Gets the rule for sleeping in the bed.- Returns:
- the rule for sleeping in the bed
- Since:
- 1.1.0
-
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
Whether the bed explodes when used in this environment.- Returns:
- whether the bed explodes when used in this environment
- Since:
- 1.1.0
-
errorMessage
-
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 bedcanSetSpawn- the rule for setting the spawn point using the bedexplodes- whether the bed explodes when used in this environmenterrorMessage- 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
Creates a new builder for bed rules.- Returns:
- a new builder for bed rules
- Since:
- 1.1.0
-