类 MobSplitEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.living.MobSplitEvent
- 所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
public class MobSplitEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
This event is fired whenever a mob is removed and splits into multiple children. It only fires on the logical server.
In vanilla, this event is fired by Slimes and Magma Cubes on death, from Slime.remove(RemovalReason)
.
Mods may elect to fire this event for any mob that splits on removal.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明返回 the mutable list of all children。返回 the parent mob, which is in the process of being removed。void
setCanceled
(boolean canceled) Canceling this event will prevent any children from being spawned.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled
-
字段详细资料
-
parent
-
children
-
-
构造器详细资料
-
MobSplitEvent
- 参数:
parent
- The parent mob, currently being removedchildren
- The list of children.- API Note:
- Use
引用无效
EventHooks#onMobSplit(Slime, List)
-
-
方法详细资料
-
getParent
返回 the parent mob, which is in the process of being removed。- 返回:
- the parent mob, which is in the process of being removed
-
getChildren
返回 the mutable list of all children。Children can be modified, removed, or added to the list.
- 返回:
- the mutable list of all children
-
setCanceled
public void setCanceled(boolean canceled) Canceling this event will prevent any children from being spawned.- 指定者:
setCanceled
在接口中net.neoforged.bus.api.ICancellableEvent
-