Package io.papermc.paper.block.bed
Interface BedEnterProblem
Represents a problem that prevents a player from continuing
the sleeping process, preventing it from sleeping and from setting
its spawn point
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BedEnterProblemHappens when the bed is set to explode.static final BedEnterProblemHappens when there are monsters in a 16x10x16 box centered on the bed's head and the player is not in creative mode.static final BedEnterProblemHappens when the bed has blocks one block above it.static final BedEnterProblemHappens when a player tries to sleep when an invalid state, for example when a player tries to sleep but is already sleeping or is dead.static final BedEnterProblemHappens when the bed is too far away from the player. -
Method Summary
Modifier and TypeMethodDescriptionReturns the error message associated with this problem, if any.
-
Field Details
-
TOO_FAR_AWAY
Happens when the bed is too far away from the player. Makes no explosion and has an error message- See Also:
-
OBSTRUCTED
Happens when the bed has blocks one block above it. Makes no explosion and has an error message- See Also:
-
NOT_SAFE
Happens when there are monsters in a 16x10x16 box centered on the bed's head and the player is not in creative mode. Makes no explosion and has an error message- See Also:
-
EXPLOSION
Happens when the bed is set to explode. This is defined in the environment attributes of the world. This doesn't have a fixed error message, seeBedEnterAction.errorMessage() -
OTHER
Happens when a player tries to sleep when an invalid state, for example when a player tries to sleep but is already sleeping or is dead. This doesn't have an error message at all, the interaction is simply discarded
-
-
Method Details
-
errorMessage
Returns the error message associated with this problem, if any. This component is sent to the client as an actionbar message when this problem occur- Returns:
- the error message
-