Class BabyEntitySpawnEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.entity.living.BabyEntitySpawnEvent
-
public class BabyEntitySpawnEvent extends net.minecraftforge.eventbus.api.EventBabyEntitySpawnEvent is fired just before a baby entity is about to be spawned.
Parents will have disengaged their relationship. {@link @Cancelable}
It is possible to change the child completely by using#setChild(EntityAgeable)
This event is fired fromEntityAIMate#spawnBaby()andEntityAIVillagerMate#giveBirth()
parentAcontains the initiating parent entity.
parentBcontains the secondary parent entity.
causedByPlayercontains the player responsible for the breading (if applicable).
childcontains the child that will be spawned.
This event isCancelable.
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.Event.HasResult
This event is fired on theMinecraftForge.EVENT_BUS.
-
-
Field Summary
Fields Modifier and Type Field Description private PlayerEntitycausedByPlayerprivate AgeableEntitychildprivate MobEntityparentAprivate MobEntityparentB
-
Constructor Summary
Constructors Constructor Description BabyEntitySpawnEvent(MobEntity parentA, MobEntity parentB, AgeableEntity proposedChild)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlayerEntitygetCausedByPlayer()AgeableEntitygetChild()MobEntitygetParentA()MobEntitygetParentB()voidsetChild(AgeableEntity proposedChild)
-
-
-
Field Detail
-
parentA
private final MobEntity parentA
-
parentB
private final MobEntity parentB
-
causedByPlayer
private final PlayerEntity causedByPlayer
-
child
private AgeableEntity child
-
-
Constructor Detail
-
BabyEntitySpawnEvent
public BabyEntitySpawnEvent(MobEntity parentA, MobEntity parentB, @Nullable AgeableEntity proposedChild)
-
-
Method Detail
-
getParentA
public MobEntity getParentA()
-
getParentB
public MobEntity getParentB()
-
getCausedByPlayer
@Nullable public PlayerEntity getCausedByPlayer()
-
getChild
@Nullable public AgeableEntity getChild()
-
setChild
public void setChild(AgeableEntity proposedChild)
-
-