类 EntityMobGriefingEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.EntityMobGriefingEvent
EntityMobGriefingEvent is fired when mob griefing is about to occur and allows an event listener to specify whether it should or not.
This event is fired when ever the mob griefing game rule is checked.
This event is fired when ever the mob griefing game rule is checked.
-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
canGrief()
返回 if the entity is allowed to perform the griefing action。boolean
Returns if the mob griefing game rule is enabled.void
setCanGrief
(boolean canGrief) Changes if the entity is allowed to perform the griefing action.从类继承的方法 net.neoforged.neoforge.event.entity.EntityEvent
getEntity
-
字段详细资料
-
isMobGriefingEnabled
private final boolean isMobGriefingEnabled -
canGrief
private boolean canGrief
-
-
构造器详细资料
-
EntityMobGriefingEvent
-
-
方法详细资料
-
isMobGriefingEnabled
public boolean isMobGriefingEnabled()Returns if the mob griefing game rule is enabled.The default state of this event is equivalent to this value.
-
setCanGrief
public void setCanGrief(boolean canGrief) Changes if the entity is allowed to perform the griefing action.- 参数:
canGrief
- True if the action should be allowed, false otherwise.
-
canGrief
public boolean canGrief()返回 if the entity is allowed to perform the griefing action。- 返回:
- if the entity is allowed to perform the griefing action
-