Class BabyEntitySpawnEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.living.BabyEntitySpawnEvent
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
public class BabyEntitySpawnEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
BabyEntitySpawnEvent is fired just before a baby entity is about to be spawned.
Parents will have disengaged their relationship.
It is possible to change the child completely by using
This event is fired from
This event is
If this event is canceled, the child Entity is not added to the world, and the parents
will no longer attempt to mate.
This event does not have a result.
This event is fired on the
Parents will have disengaged their relationship.
ICancellableEvent It is possible to change the child completely by using
setChild(AgeableMob) This event is fired from
Animal.spawnChildFromBreeding(ServerLevel, Animal) and
Animal.spawnChildFromBreeding(ServerLevel, Animal) parentA contains the initiating parent entity.parentB contains the secondary parent entity.causedByPlayer contains the player responsible for the breading (if applicable).child contains the child that will be spawned.This event is
ICancellableEvent.If this event is canceled, the child Entity is not added to the world, and the parents
will no longer attempt to mate.
This event does not have a result.
invalid reference
HasResult
This event is fired on the
NeoForge.EVENT_BUS.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Playerprivate AgeableMobprivate final Mobprivate final Mob -
Constructor Summary
ConstructorsConstructorDescriptionBabyEntitySpawnEvent(Mob parentA, Mob parentB, @Nullable AgeableMob proposedChild) -
Method Summary
Modifier and TypeMethodDescription@Nullable Player@Nullable AgeableMobgetChild()voidsetChild(AgeableMob proposedChild) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
parentA
-
parentB
-
causedByPlayer
-
child
-
-
Constructor Details
-
BabyEntitySpawnEvent
-
-
Method Details
-
getParentA
-
getParentB
-
getCausedByPlayer
-
getChild
-
setChild
-