Uses of Class
net.neoforged.neoforge.event.entity.living.LivingEvent
Packages that use LivingEvent
Package
Description
Events fired only on the client-side, chiefly related to rendering and user interfaces (screens and input).
-
Uses of LivingEvent in net.neoforged.neoforge.client.event
Subclasses of LivingEvent in net.neoforged.neoforge.client.eventModifier and TypeClassDescriptionclassFired after the player's movement inputs are updated.classFired 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. -
Uses of LivingEvent in net.neoforged.neoforge.event
Subclasses of LivingEvent in net.neoforged.neoforge.event -
Uses of LivingEvent in net.neoforged.neoforge.event.brewing
Subclasses of LivingEvent in net.neoforged.neoforge.event.brewingModifier and TypeClassDescriptionclassThis event is called when a player picks up a potion from a brewing stand. -
Uses of LivingEvent in net.neoforged.neoforge.event.entity.living
Subclasses of LivingEvent in net.neoforged.neoforge.event.entity.livingModifier and TypeClassDescriptionclassThis event is fired when anAnimalis tamed.classFired on both sides when aLivingEntity's armor is dealt damage indoHurtEquipment.classFires for each effect to allow modification or replacement of the particle options (you can set it to null to reset it to default).classThis event is fired on the forge bus before an Enderman detects that a player is looking at them.classLivingBreatheEvent is fired whenever a living entity ticks.
This event is fired viaCommonHooks.onLivingBreathe(LivingEntity, int, int).
This event is not.invalid reference
ICancellableEvent
This event does not have a result.classThis event allows you to change the target an entity has.classstatic classLivingConversionEvent.Post is triggered when an entity is replacing itself with another entity.static classLivingConversionEvent.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.classLivingDamageEvent captures an entity's loss of health.static classLivingDamageEvent.Post is fired after health is modified on the entity.
The fields in this event represent the FINAL values of what was applied to the entity.static classLivingDamageEvent.Pre is fired when an Entity is set to be hurt.classLivingDeathEvent is fired when an Entity dies.classFired when the ender dragon or wither attempts to destroy a block and when ever a zombie attempts to break a door.classLivingDropsEvent 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 the.invalid reference
CommonHooks#onLivingDrops(LivingEntity, DamageSource, Collection, int, boolean)
LivingDropsEvent.sourcecontains the DamageSource that caused the drop to occur.
LivingDropsEvent.dropscontains the ArrayList of EntityItems that will be dropped.
contains the amount of loot that will be dropped.invalid reference
#lootingLevel
LivingDropsEvent.recentlyHitdetermines 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.classLivingDrownEvent is fired whenever a living entity can't breathe and its air supply is less than or equal to zero.classstatic classFired after an item has fully finished being used.static classFired when a player starts 'using' an item, typically when they hold right mouse.static classFired when a player stops using an item without the use duration timing out.static classFired every tick that a player is 'using' an item, seeLivingEntityUseItemEvent.Startfor info.classLivingEquipmentChangeEventis fired when the Equipment of a Entity changes.static classLivingJumpEvent 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 classclassEvent 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.classLivingFallEvent is fired when an Entity is set to be falling.
This event is fired whenever an Entity is set to fall inLivingEntity.causeFallDamage(double, float, DamageSource).
This event is fired via theCommonHooks.onLivingFall(LivingEntity, double, float).
LivingFallEvent.distancecontains the distance the Entity is to fall.classThis event is fired when a living entity attempts to get a projectile with theLivingEntity.getProjectile(ItemStack)method.classLivingHealEvent is fired when an Entity is set to be healed.classLivingIncomingDamageEvent is fired when a LivingEntity is about to receive damage.classLivingKnockBackEvent is fired when a living entity is about to be knocked back.classLivingShieldBlockEvent is fired when an entity is hurt and vanilla checks if the entity is attempting to block 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.classstatic classThis event is fired when a living entity is about to swap the items in their main and offhand.classFired when an Entity attempts to use a totem to prevent its death.classThis event is fired when an interaction between aLivingEntityandMobEffectInstancehappens.static classThis event is fired when a newMobEffectInstanceis added to an entity.static classThis event is fired to check if aMobEffectInstancecan be applied to an entity.static classThis event is fired when aMobEffectInstanceexpires on an entity.static classThis Event is fired when aMobEffectis about to get removed from an Entity.classThis 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 LivingEvent in net.neoforged.neoforge.event.entity.player
Subclasses of LivingEvent in net.neoforged.neoforge.event.entity.playerModifier and TypeClassDescriptionclassBase class used for advancement-related events.static classFired when the player earns an advancement.static classFired when the player's progress on an advancement criterion is granted or revoked.classThe AnvilCraftEvent is fired when the playerpicks up the resultof an anvil operation, "crafting" it.static classThis event is fired after the player picks up the result of the anvil operation, and all post-processing has occurred.static classThis event is fired when the player picks up the result of the anvil operation, but before any post-processing occurs.classArrowLooseEvent 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.bowcontains the ItemBow ItemStack that was used in this event.
ArrowLooseEvent.chargecontains 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.classArrowNockEvent 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.classAttackEntityEvent is fired when a player attacks an Entity.
This event is fired whenever a player attacks an Entity inPlayer.attack(Entity).
AttackEntityEvent.targetcontains the Entity that was damaged by the player.classThis event is fired when the game checks if a sleeping entity may continue sleeping.classCalled fromServerPlayer.startSleepInBed(BlockPos)when a player attempts to sleep.classClientInformationUpdatedEvent is fired when a player changes server-synced client options, specifically those inClientInformation.classThis event is fired when a player attacks an entity inPlayer.attack(Entity).classThis event is called when a player fishes an item.classclassThis event will fire when the player is opped or deopped.classstatic classstatic classclassPlayerDestroyItemEvent is fired when a player destroys an item.
This event is fired whenever a player destroys an item in,invalid reference
MultiPlayerGameMode#destroyBlock(BlockPos),invalid reference
MultiPlayerGameMode#useItem(Player, InteractionHand),invalid reference
MultiPlayerGameMode#useItemOn(LocalPlayer, InteractionHand, BlockHitResult)Player.attack(Entity),Player#hurtCurrentlyUsedShield(float),Player.interactOn(Entity, InteractionHand),CommonHooks.getCraftingRemainder(ItemStack),ServerPlayerGameMode.useItem(ServerPlayer, Level, ItemStack, InteractionHand),ServerPlayerGameMode.useItemOn(ServerPlayer, Level, ItemStack, InteractionHand, BlockHitResult)andServerPlayerGameMode.destroyBlock(BlockPos).
PlayerDestroyItemEvent.originalcontains the original ItemStack before the item was destroyed.classThis event fires when a player enchants an item, afterIItemExtension.applyEnchantments(net.minecraft.world.item.ItemStack, java.util.List<net.minecraft.world.item.enchantment.EnchantmentInstance>)has been called.classPlayerEvent is fired whenever an event involving aPlayeroccurs.static classBreakSpeed is fired when a player attempts to harvest a block.
This event is fired whenever a player attempts to harvest a block in.invalid reference
Player#getDigSpeed(BlockState, BlockPos)
This event is fired via theEventHooks.getBreakSpeed(Player, BlockState, float, BlockPos).
PlayerEvent.BreakSpeed.statecontains the block being broken.static classFired when the EntityPlayer is cloned, typically caused by the impl sending a RESPAWN_PLAYER event.static classHarvestCheck 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.statecontains theBlockStatethat is being checked for harvesting.static classstatic classstatic classThe player is being loaded from the world save.static classNameFormat 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.usernamecontains the username of the player.static classstatic classFired when the game type of a server player is changed to a different value than what it was previously.static classstatic classstatic classstatic classThe player is being saved to the world store.static classFired when an Entity is started to be "tracked" by this player (the player receives updates about this entity, e.g. motion).static classFired when an Entity is stopped to be "tracked" by this player (the player no longer receives updates about this entity, e.g. motion).static classTabListNameFormat 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.classOccurs when a player falls, but is able to fly.classPlayerInteractEvent is fired when a player interacts in some way.static classThis event is fired on both sides when the player right clicks an entity.static classThis event is fired on both sides whenever a player right clicks an entity.static classThis event is fired when a player left clicks while targeting a block.static classThis event is fired on the client side when the player left clicks empty space with any ItemStack.static classThis event is fired on both sides whenever the player right clicks while targeting a block.static classThis event is fired on the client side when the player right clicks empty space with an empty hand.static classThis event is fired on both sides before the player triggersItem.use(Level, Player, InteractionHand).classFired bybefore the server respawns a player.invalid reference
PlayerList#respawn(ServerPlayer, boolean)classThis 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.classThis 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.classThis 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.classPlayerXpEvent is fired whenever an event involving player experience occurs.static classThis event is fired when the player's experience level changes through thePlayer.giveExperienceLevels(int)method.static classThis event is fired after the player collides with an experience orb, but before the player has been given the experience.static classThis event is fired when the player's experience changes through thePlayer.giveExperiencePoints(int)method.classThe SweepAttackEvent is fired when aPlayerattacks a target, after theCriticalHitEventhas been fired.classFired when a player trades with anAbstractVillager. -
Uses of LivingEvent in net.neoforged.neoforge.event.tick
Subclasses of LivingEvent in net.neoforged.neoforge.event.tickModifier and TypeClassDescriptionclassBase class of the two player tick events.static classPlayerTickEvent.Postis fired once per game tick, per player, after the player performs work for the current tick.static classPlayerTickEvent.Preis fired once per game tick, per player, before the player performs work for the current tick.