类 CanContinueSleepingEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.player.CanContinueSleepingEvent
This event is fired when the game checks if a sleeping entity may continue sleeping.
It can be used to overwrite the vanilla check, forcing the entity to continue or stop sleeping.
This event is only fired on the logical server.
-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明@Nullable Player.BedSleepingProblem
Returns the current sleeping problem, if any.Returns the sleeping position of the sleeping entity.boolean
返回 if the sleeping entity may continue sleeping。void
setContinueSleeping
(boolean sleeping) Sets if the sleeping entity may continue sleeping.从类继承的方法 net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
-
字段详细资料
-
problem
-
mayContinueSleeping
protected boolean mayContinueSleeping
-
-
构造器详细资料
-
CanContinueSleepingEvent
public CanContinueSleepingEvent(LivingEntity entity, @Nullable @Nullable Player.BedSleepingProblem problem)
-
-
方法详细资料
-
getSleepingPos
Returns the sleeping position of the sleeping entity. May be empty. -
getProblem
Returns the current sleeping problem, if any. By default, this event is fired with the following problems:Player.BedSleepingProblem.NOT_POSSIBLE_HERE
if the sleeper is missing a bed.Player.BedSleepingProblem.NOT_POSSIBLE_NOW
if it is daytime.
-
mayContinueSleeping
public boolean mayContinueSleeping()返回 if the sleeping entity may continue sleeping。- 返回:
- if the sleeping entity may continue sleeping
-
setContinueSleeping
public void setContinueSleeping(boolean sleeping) Sets if the sleeping entity may continue sleeping. By default, the entity may continue sleeping if there was not a problem detected.
-