Uses of Class
net.neoforged.neoforge.event.entity.EntityEvent
Package
Description
Events fired only on the client-side, chiefly related to rendering and user interfaces (screens and input).
-
Uses of EntityEvent in net.neoforged.neoforge.client.event
Modifier and TypeClassDescriptionclass
Fired after the player's movement inputs are updated.class
This event is fired before an entity renderer renders the nameplate of an entity.class
Fired when a player is being rendered.static class
Fired after the player is rendered, if the correspondingRenderPlayerEvent.Pre
is not cancelled.static class
Fired before the player is rendered. -
Uses of EntityEvent in net.neoforged.neoforge.event
-
Uses of EntityEvent in net.neoforged.neoforge.event.brewing
Modifier and TypeClassDescriptionclass
This event is called when a player picks up a potion from a brewing stand. -
Uses of EntityEvent in net.neoforged.neoforge.event.entity
Modifier and TypeClassDescriptionstatic class
This event is fired on server and client after an Entity has entered a different section.static class
EntityConstructing is fired when an Entity is being created.static class
This event is fired whenever thePose
changes, and in a few other hardcoded scenarios.
CAREFUL: This is also fired in the Entity constructor.class
class
class
EntityMobGriefingEvent is fired when mob griefing is about to occur and allows an event listener to specify whether it should or not.
This event is fired when ever the mob griefing game rule is checked.class
This event gets fired whenever a entity mounts/dismounts another entity.
entityBeingMounted can be null, be sure to check for that.class
EntityStruckByLightningEvent is fired when an Entity is about to be struck by lightening.
This event is fired whenever an EntityLightningBolt is updated to strike an Entity inLightningBolt.tick()
viaEventHooks.onEntityStruckByLightning(Entity, LightningBolt)
.
EntityStruckByLightningEvent.lightning
contains the instance of EntityLightningBolt attempting to strike an entity.
This event isICancellableEvent
.
If this event is canceled, the Entity is not struck by the lightening.
This event does not have a result.class
EntityTeleportEvent is fired when an event involving any teleportation of an Entity occurs.
If a method utilizes thisEvent
as its parameter, the method will receive every child event of this class.
EntityTeleportEvent.getTarget()
contains the target destination.
EntityTeleportEvent.getPrev()
contains the entity's current position.
All children of this event are fired on theNeoForge.EVENT_BUS
.static class
EntityTeleportEvent.ChorusFruit is fired before a LivingEntity is teleported due to consuming Chorus Fruit.static class
EntityTeleportEvent.EnderEntity is fired before an Enderman or Shulker randomly teleports.static class
EntityTeleportEvent.EnderPearl is fired before an Entity is teleported from an EnderPearlEntity.static class
EntityTeleportEvent.SpreadPlayersCommand is fired before a living entity is teleported from use ofSpreadPlayersCommand
.static class
EntityTeleportEvent.TeleportCommand is fired before a living entity is teleported from use ofTeleportCommand
.class
EntityTravelToDimensionEvent is fired before an Entity travels to a dimension.
EntityTravelToDimensionEvent.dimension
contains the id of the dimension the entity is traveling to.
This event isICancellableEvent
.
If this event is canceled, the Entity does not travel to the dimension.
This event does not have a result.class
This event is fired on theNeoForge.EVENT_BUS
.
This event is fired when a projectile entity impacts something.
This event is fired viaEventHooks.onProjectileImpact(Projectile, HitResult)
This event is fired for all vanilla projectiles by Forge, custom projectiles should fire this event and check the result in a similar fashion. -
Uses of EntityEvent in net.neoforged.neoforge.event.entity.item
Modifier and TypeClassDescriptionclass
Base class for allItemEntity
events.class
Event that is fired when an EntityItem's age has reached its maximum lifespan.class
Event that is fired whenever a player tosses (Q) an item or drag-n-drops a stack of items outside the inventory GUI screens. -
Uses of EntityEvent in net.neoforged.neoforge.event.entity.living
Modifier and TypeClassDescriptionclass
This event is fired when anAnimal
is tamed.class
Fires for each effect to allow modification or replacement of the particle options (you can set it to null to reset it to default).class
This event is fired on the forge bus before an Enderman detects that a player is looking at them.class
This event is fired beforeMob.finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor, net.minecraft.world.DifficultyInstance, net.minecraft.world.entity.MobSpawnType, net.minecraft.world.entity.SpawnGroupData)
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).class
LivingAttackEvent is fired when a living Entity is attacked.class
LivingBreatheEvent is fired whenever a living entity ticks.
This event is fired viaCommonHooks.onLivingBreathe(LivingEntity, int, int)
.
This event is notinvalid reference
ICancellableEvent
This event does not have a result.class
This event allows you to change the target an entity has.class
static class
LivingConversionEvent.Post is triggered when an entity is replacing itself with another entity.static class
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.class
LivingDamageEvent is fired just before damage is applied to entity.
At this point armor, potion and absorption modifiers have already been applied to damage - this is FINAL value.
Also note that appropriate resources (like armor durability and absorption extra hearths) have already been consumed.
This event is fired whenever an Entity is damaged inLivingEntity#actuallyHurt(DamageSource, float)
andPlayer#actuallyHurt(DamageSource, float)
.
This event is fired via theCommonHooks.onLivingDamage(LivingEntity, DamageSource, float)
.
LivingDamageEvent.source
contains the DamageSource that caused this Entity to be hurt.class
LivingDeathEvent is fired when an Entity dies.class
Fired when the ender dragon or wither attempts to destroy a block and when ever a zombie attempts to break a door.class
LivingDropsEvent is fired when an Entity's death causes dropped items to appear.
This event is fired whenever an Entity dies and drops items inLivingEntity.die(DamageSource)
.
This event is fired via theinvalid reference
CommonHooks#onLivingDrops(LivingEntity, DamageSource, Collection, int, boolean)
LivingDropsEvent.source
contains the DamageSource that caused the drop to occur.
LivingDropsEvent.drops
contains the ArrayList of EntityItems that will be dropped.
invalid reference
#lootingLevel
LivingDropsEvent.recentlyHit
determines whether the Entity doing the drop has recently been damaged.
This event isICancellableEvent
.
If this event is canceled, the Entity does not drop anything.
This event does not have a result.class
LivingDrownEvent is fired whenever a living entity can't breathe and its air supply is less than or equal to zero.class
static class
Fired after an item has fully finished being used.static class
Fired when a player starts 'using' an item, typically when they hold right mouse.static class
Fired when a player stops using an item without the use duration timing out.static class
Fired every tick that a player is 'using' an item, seeLivingEntityUseItemEvent.Start
for info.class
LivingEquipmentChangeEvent
is fired when the Equipment of a Entity changes.class
LivingEvent is fired whenever an event involving aLivingEntity
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 theNeoForge.EVENT_BUS
.static class
LivingJumpEvent is fired when an Entity jumps.
This event is fired whenever an Entity jumps inLivingEntity#jumpFromGround()
,MagmaCube#jumpFromGround()
,Slime#jumpFromGround()
,Camel#executeRidersJump()
, andAbstractHorse#executeRidersJump()
.
This event is fired via theCommonHooks.onLivingJump(LivingEntity)
.
This event is notICancellableEvent
.
This event does not have a result.static class
class
Event for when an entity drops experience on its death, can be used to change the amount of experience points dropped or completely prevent dropping of experience by canceling the event.class
LivingFallEvent is fired when an Entity is set to be falling.
This event is fired whenever an Entity is set to fall inLivingEntity.causeFallDamage(float, float, DamageSource)
.
This event is fired via theCommonHooks.onLivingFall(LivingEntity, float, float)
.
LivingFallEvent.distance
contains the distance the Entity is to fall.class
This event is fired when a living entity attempts to get a projectile with theLivingEntity.getProjectile(ItemStack)
method.class
LivingHealEvent is fired when an Entity is set to be healed.class
LivingHurtEvent is fired when an Entity is set to be hurt.class
LivingKnockBackEvent is fired when a living entity is about to be knocked back.class
static class
This event is fired when a living entity is about to swap the items in their main and offhand.class
Fired when an Entity attempts to use a totem to prevent its death.class
This event is fired fromMob.checkDespawn()
.
It fires once per tick per mob that is attempting to despawn.class
This event is fired when an interaction between aLivingEntity
andMobEffectInstance
happens.static class
This event is fired when a newMobEffectInstance
is added to an entity.static class
This event is fired to check if aMobEffectInstance
can be applied to an entity.static class
This event is fired when aMobEffectInstance
expires on an entity.static class
This Event is fired when aMobEffect
is about to get removed from an Entity.class
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:static class
This event is fired when a mob checks for a valid spawn position, afterSpawnPlacements.checkSpawnRules(net.minecraft.world.entity.EntityType<T>, net.minecraft.world.level.ServerLevelAccessor, net.minecraft.world.entity.MobSpawnType, net.minecraft.core.BlockPos, net.minecraft.util.RandomSource)
has been evaluated.
Conditions validated here include the following: Obstruction - mobs inside blocks or fluids. Pathfinding - if the spawn block is valid for pathfinding. Sea Level - Ocelots check if the position is above sea level. Spawn Block - Ocelots check if the below block is grass or leaves.class
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.class
This event is fired fromNaturalSpawner.spawnCategoryForPosition(net.minecraft.world.entity.MobCategory, net.minecraft.server.level.ServerLevel, net.minecraft.core.BlockPos)
when the spawning system determines the maximum amount of the selected entity that can spawn at the same time. -
Uses of EntityEvent in net.neoforged.neoforge.event.entity.player
Modifier and TypeClassDescriptionclass
Base class used for advancement-related events.static class
Fired when the player earns an advancement.static class
Fired when the player's progress on an advancement criterion is granted or revoked.class
Fired when the player removes a "repaired" item from the Anvil's Output slot.class
ArrowLooseEvent is fired when a player stops using a bow.
This event is fired whenever a player stops using a bow inBowItem.releaseUsing(ItemStack, Level, LivingEntity, int)
.
ArrowLooseEvent.bow
contains the ItemBow ItemStack that was used in this event.
ArrowLooseEvent.charge
contains the value for how much the player had charged before stopping the shot.
This event isICancellableEvent
.
If this event is canceled, the player does not stop using the bow.
For crossbows, the charge will always be 1; Set it to -1 in order to prevent firing the arrow.class
ArrowNockEvent is fired when a player begins using a bow.
This event is fired whenever a player begins using a bow inBowItem.use(Level, Player, InteractionHand)
.
This event isICancellableEvent
.class
AttackEntityEvent is fired when a player attacks an Entity.
This event is fired whenever a player attacks an Entity inPlayer.attack(Entity)
.
AttackEntityEvent.target
contains the Entity that was damaged by the player.class
This event is fired when the game checks if a sleeping entity may continue sleeping.class
Called fromServerPlayer.startSleepInBed(BlockPos)
when a player attempts to sleep.class
This event is fired when a player attacks an entity inPlayer.attack(Entity)
.class
This event is called when a player fishes an item.class
class
This event will fire when the player is opped or deopped.class
static class
static class
class
PlayerDestroyItemEvent is fired when a player destroys an item.
This event is fired whenever a player destroys an item inMultiPlayerGameMode.destroyBlock(BlockPos)
,MultiPlayerGameMode.useItem(Player, InteractionHand)
,MultiPlayerGameMode.useItemOn(LocalPlayer, InteractionHand, BlockHitResult)
,Player.attack(Entity)
,Player#hurtCurrentlyUsedShield(float)
,Player.interactOn(Entity, InteractionHand)
,CommonHooks.getCraftingRemainingItem(ItemStack)
,ServerPlayerGameMode.useItem(ServerPlayer, Level, ItemStack, InteractionHand)
,ServerPlayerGameMode.useItemOn(ServerPlayer, Level, ItemStack, InteractionHand, BlockHitResult)
andServerPlayerGameMode.destroyBlock(BlockPos)
.
PlayerDestroyItemEvent.original
contains the original ItemStack before the item was destroyed.class
PlayerEvent is fired whenever an event involving aPlayer
occurs.static class
BreakSpeed is fired when a player attempts to harvest a block.
This event is fired whenever a player attempts to harvest a block inPlayer.getDigSpeed(BlockState, BlockPos)
.
This event is fired via theEventHooks.getBreakSpeed(Player, BlockState, float, BlockPos)
.
PlayerEvent.BreakSpeed.state
contains the block being broken.static class
Fired when the EntityPlayer is cloned, typically caused by the impl sending a RESPAWN_PLAYER event.static class
HarvestCheck is fired when a player attempts to harvest a block.
This event is fired whenever a player attempts to harvest a block inPlayer.hasCorrectToolForDrops(BlockState)
.
This event is fired via theEventHooks.doPlayerHarvestCheck(Player, BlockState, BlockGetter, BlockPos)
.
PlayerEvent.HarvestCheck.state
contains theBlockState
that is being checked for harvesting.static class
static class
static class
The player is being loaded from the world save.static class
NameFormat is fired when a player's display name is retrieved.
This event is fired whenever a player's name is retrieved inPlayer.getDisplayName()
orPlayer.refreshDisplayName()
.
This event is fired via theEventHooks.getPlayerDisplayName(Player, Component)
.
PlayerEvent.NameFormat.username
contains the username of the player.static class
static class
Fired when the game type of a server player is changed to a different value than what it was previously.static class
static class
static class
static class
The player is being saved to the world store.static class
Fired when an Entity is started to be "tracked" by this player (the player receives updates about this entity, e.g.static class
Fired when an Entity is stopped to be "tracked" by this player (the player no longer receives updates about this entity, e.g.static class
TabListNameFormat is fired when a player's display name for the tablist is retrieved.
This event is fired whenever a player's display name for the tablist is retrieved inServerPlayer.getTabListDisplayName()
orServerPlayer.refreshTabListName()
.
This event is fired via theEventHooks.getPlayerTabListDisplayName(Player)
.
PlayerEvent.TabListNameFormat.getDisplayName()
contains the display name of the player or null if the client should determine the display name itself.class
Occurs when a player falls, but is able to fly.class
Fired byGui.HeartType.forPlayer(net.minecraft.world.entity.player.Player)
to allow mods to change the heart sprite which is displayed in the player's health bar.class
PlayerInteractEvent is fired when a player interacts in some way.static class
This event is fired on both sides when the player right clicks an entity.static class
This event is fired on both sides whenever a player right clicks an entity.static class
This event is fired when a player left clicks while targeting a block.static class
This event is fired on the client side when the player left clicks empty space with any ItemStack.static class
This event is fired on both sides whenever the player right clicks while targeting a block.static class
This event is fired on the client side when the player right clicks empty space with an empty hand.static class
This event is fired on both sides before the player triggersItem.use(Level, Player, InteractionHand)
.class
Fired byinvalid reference
PlayerList#respawn(ServerPlayer, boolean)
class
This event is fired when a player's spawn point is set or reset.
The event can be canceled, which will prevent the spawn point from being changed.class
This event is fired fromPhantomSpawner.tick(net.minecraft.server.level.ServerLevel, boolean, boolean)
when phantoms would attempt to be spawned, with one event fired per player.class
This event is fired when the player is waking up.
This is merely for purposes of listening for this to happen.
There is nothing that can be manipulated with this event.class
PlayerXpEvent is fired whenever an event involving player experience occurs.static class
This event is fired when the player's experience level changes through thePlayer.giveExperienceLevels(int)
method.static class
This event is fired after the player collides with an experience orb, but before the player has been given the experience.static class
This event is fired when the player's experience changes through thePlayer.giveExperiencePoints(int)
method.class
Fired when a player trades with anAbstractVillager
.class
-
Uses of EntityEvent in net.neoforged.neoforge.event.tick
Modifier and TypeClassDescriptionclass
Base class of the two entity tick events.static class
EntityTickEvent.Post
is fired once per game tick, per entity, after the entity performs work for the current tick.static class
EntityTickEvent.Pre
is fired once per game tick, per entity, before the entity performs work for the current tick.class
Base class of the two player tick events.static class
PlayerTickEvent.Post
is fired once per game tick, per player, after the player performs work for the current tick.static class
PlayerTickEvent.Pre
is fired once per game tick, per player, before the player performs work for the current tick.