Uses of Package
net.minecraftforge.event.entity.living
Package
Description
Events fired only on the client-side, chiefly related to rendering and user interfaces (screens and input).
-
ClassDescriptionLivingEvent is fired whenever an event involving a
LivingEntity
occurs.
If a method utilizes thisEvent
as its parameter, the method will receive every child event of this class.
All children of this event are fired on theMinecraftForge.EVENT_BUS
. -
ClassDescriptionThis event allows you to change the target an entity has.A living target type indicates what kind of system caused a change of targets.LivingKnockBackEvent is fired when a living entity is about to be knocked back.This event is fired when a living entity is about to swap the items in their main and offhand.The ShieldBlockEvent is fired when an entity successfully blocks with a shield.
Cancelling this event will have the same impact as if the shield was not eligible to block.
The damage blocked cannot be set lower than zero or greater than the original value.
Note: The shield item stack "should" be available fromLivingEntity.getUseItem()
at least for players. -
ClassDescriptionThis event is fired when a new
MobEffectInstance
is added to an entity.This event is fired to check if aMobEffectInstance
can be applied to an entity.This event is fired when aMobEffectInstance
expires on an entity.This Event is fired when aMobEffect
is about to get removed from an Entity. -
ClassDescriptionThis event allows you to change the target an entity has.LivingConversionEvent.Post is triggered when an entity is replacing itself with another entity.LivingConversionEvent.Pre is triggered when an entity is trying to replace itself with another entity This event may trigger every tick even if it was cancelled last tick for entities like Zombies and Hoglins.This event is fired when a living entity attempts to get a projectile with the
LivingEntity.getProjectile(ItemStack)
method.LivingMakeBrainEvent is fired whenever a newBrain
instance is created usingLivingEntity.makeBrain(Dynamic)
.
To access the internalBrainBuilder
, callLivingMakeBrainEvent.getTypedBrainBuilder(LivingEntity)
using the downcastedLivingEntity
obtained fromLivingEvent.getEntity()
.
The BrainBuilder will initially contain all the state found in the original Brain instance.
After this event is posted, a fresh Brain instance will be created using the encapsulated state found in the BrainBuilder and replace the previously created Brain instance for the entity.
This event is fired via theForgeHooks.onLivingMakeBrain(LivingEntity, Brain, Dynamic)
.
This event is notCancelable
.
This event does not have a result.This event is fired when a living entity is about to swap the items in their main and offhand. -
ClassDescriptionThe ShieldBlockEvent is fired when an entity successfully blocks with a shield.
Cancelling this event will have the same impact as if the shield was not eligible to block.
The damage blocked cannot be set lower than zero or greater than the original value.
Note: The shield item stack "should" be available fromLivingEntity.getUseItem()
at least for players. -
ClassDescriptionThis event is fired before
Mob.finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor, net.minecraft.world.DifficultyInstance, net.minecraft.world.entity.MobSpawnType, net.minecraft.world.entity.SpawnGroupData, net.minecraft.nbt.CompoundTag)
is called.
This allows mods to control mob initialization.
In vanilla code, this event is injected by a transformer and not via patch, so calls cannot be traced via call hierarchy (it is not source-visible).SummonAidEvent is fired when a Zombie Entity is summoned. -
ClassDescriptionLivingEvent is fired whenever an event involving a
LivingEntity
occurs.
If a method utilizes thisEvent
as its parameter, the method will receive every child event of this class.
All children of this event are fired on theMinecraftForge.EVENT_BUS
. -
ClassDescriptionA living target type indicates what kind of system caused a change of targets.This enum contains two default living target types.LivingEvent is fired whenever an event involving a
LivingEntity
occurs.
If a method utilizes thisEvent
as its parameter, the method will receive every child event of this class.
All children of this event are fired on theMinecraftForge.EVENT_BUS
.This event is fired when an interaction between aLivingEntity
andMobEffectInstance
happens.This class holds all events relating to the entire flow of mob spawns.
Currently, the events have the following flow for any given mob spawn:ZombieEvent is fired whenever a zombie is spawned for aid. -
ClassDescriptionLivingEvent is fired whenever an event involving a
LivingEntity
occurs.
If a method utilizes thisEvent
as its parameter, the method will receive every child event of this class.
All children of this event are fired on theMinecraftForge.EVENT_BUS
.