Class BabyEntitySpawnEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.entity.living.BabyEntitySpawnEvent
-
public class BabyEntitySpawnEvent extends net.minecraftforge.eventbus.api.Event
BabyEntitySpawnEvent 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()
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 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 PlayerEntity
causedByPlayer
private AgeableEntity
child
private MobEntity
parentA
private MobEntity
parentB
-
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 PlayerEntity
getCausedByPlayer()
AgeableEntity
getChild()
MobEntity
getParentA()
MobEntity
getParentB()
void
setChild(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)
-
-