Class MobSplitEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.living.MobSplitEvent
- All Implemented Interfaces:
- 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.
- 
Nested Class SummaryNested classes/interfaces inherited from class net.neoforged.bus.api.Eventnet.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the mutable list of all children.Returns the parent mob, which is in the process of being removed.voidsetCanceled(boolean canceled) Canceling this event will prevent any children from being spawned.Methods inherited from class net.neoforged.bus.api.EventgetResult, hasResult, setResultMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEventisCanceled
- 
Field Details- 
parent
- 
children
 
- 
- 
Constructor Details- 
MobSplitEvent- Parameters:
- parent- The parent mob, currently being removed
- children- The list of children.
 
 
- 
- 
Method Details- 
getParentReturns the parent mob, which is in the process of being removed.- Returns:
- the parent mob, which is in the process of being removed
 
- 
getChildrenReturns the mutable list of all children.Children can be modified, removed, or added to the list. - Returns:
- the mutable list of all children
 
- 
setCanceledpublic void setCanceled(boolean canceled) Canceling this event will prevent any children from being spawned.- Specified by:
- setCanceledin interface- net.neoforged.bus.api.ICancellableEvent
 
 
-