Uses of Class
net.minecraftforge.event.entity.player.PlayerEvent
Package
Description
-
Uses of PlayerEvent in net.minecraftforge.client.event
Modifier and TypeClassDescriptionclass
This event is fired after player movement inputs are updated.
Handlers can freely manipulateInput
to cancel movement.class
static class
static class
-
Uses of PlayerEvent in net.minecraftforge.event.brewing
Modifier and TypeClassDescriptionclass
This event is called when a player picks up a potion from a brewing stand. -
Uses of PlayerEvent in net.minecraftforge.event.entity.player
Modifier and TypeClassDescriptionclass
This event is fired when a player gets an advancement.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 isCancelable
.
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 is fired on theMinecraftForge.EVENT_BUS
.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 called when a player attempts to use Bonemeal on a block.class
This event is fired whenever a player attacks an Entity in EntityPlayer#attackTargetEntityWithCurrentItem(Entity).
This event is notCancelable
.
This event has a result.class
This event is called when a player collides with a EntityItem on the ground.class
This event is fired when a player attempts to use a Empty bucket, it can be canceled to completely prevent any further processing.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, Level, InteractionHand)
,MultiPlayerGameMode.useItemOn(LocalPlayer, ClientLevel, InteractionHand, BlockHitResult)
,Player.attack(Entity)
,Player#hurtCurrentlyUsedShield(float)
,Player.interactOn(Entity, InteractionHand)
,ForgeHooks.getContainerItem(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.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 theForgeEventFactory.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 theForgeEventFactory.doPlayerHarvestCheck(Player, BlockState, boolean)
.
PlayerEvent.HarvestCheck.state
contains theBlockState
that is being checked for harvesting.static class
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 theForgeEventFactory.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 theForgeEventFactory.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
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
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
PlayerSleepInBedEvent is fired when a player sleeps in a bed.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
This event is fired when the game checks if players can sleep at this time.
Failing this check will cause sleeping players to wake up and prevent awake players from sleeping.
This event has a result.class
Deprecated, for removal: This API element is subject to removal in a future version.