Class PlayerEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.entity.EntityEvent
-
- net.minecraftforge.event.entity.living.LivingEvent
-
- net.minecraftforge.event.entity.player.PlayerEvent
-
- Direct Known Subclasses:
AdvancementEvent
,AnvilRepairEvent
,ArrowLooseEvent
,ArrowNockEvent
,AttackEntityEvent
,BonemealEvent
,CriticalHitEvent
,EntityItemPickupEvent
,FillBucketEvent
,InputUpdateEvent
,ItemFishedEvent
,ItemTooltipEvent
,PlayerBrewedPotionEvent
,PlayerContainerEvent
,PlayerDestroyItemEvent
,PlayerEvent.BreakSpeed
,PlayerEvent.Clone
,PlayerEvent.HarvestCheck
,PlayerEvent.ItemCraftedEvent
,PlayerEvent.ItemPickupEvent
,PlayerEvent.ItemSmeltedEvent
,PlayerEvent.LoadFromFile
,PlayerEvent.NameFormat
,PlayerEvent.PlayerChangedDimensionEvent
,PlayerEvent.PlayerChangeGameModeEvent
,PlayerEvent.PlayerLoggedInEvent
,PlayerEvent.PlayerLoggedOutEvent
,PlayerEvent.PlayerRespawnEvent
,PlayerEvent.SaveToFile
,PlayerEvent.StartTracking
,PlayerEvent.StopTracking
,PlayerEvent.TabListNameFormat
,PlayerEvent.Visibility
,PlayerFlyableFallEvent
,PlayerInteractEvent
,PlayerSetSpawnEvent
,PlayerSleepInBedEvent
,PlayerWakeUpEvent
,PlayerXpEvent
,RenderPlayerEvent
,SleepingTimeCheckEvent
,UseHoeEvent
public class PlayerEvent extends LivingEvent
PlayerEvent is fired whenever an event involving Living entities 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
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PlayerEvent.BreakSpeed
BreakSpeed is fired when a player attempts to harvest a block.
This event is fired whenever a player attempts to harvest a block inEntityPlayer#canHarvestBlock(IBlockState)
.
This event is fired via theForgeEventFactory#getBreakSpeed(EntityPlayer, IBlockState, float, BlockPos)
.
PlayerEvent.BreakSpeed.state
contains the block being broken.static class
PlayerEvent.Clone
Fired when the EntityPlayer is cloned, typically caused by the network sending a RESPAWN_PLAYER event.static class
PlayerEvent.HarvestCheck
HarvestCheck is fired when a player attempts to harvest a block.
This event is fired whenever a player attempts to harvest a block inEntityPlayer#canHarvestBlock(IBlockState)
.
This event is fired via theForgeEventFactory#doPlayerHarvestCheck(EntityPlayer, IBlockState, boolean)
.
PlayerEvent.HarvestCheck.state
contains theIBlockState
that is being checked for harvesting.static class
PlayerEvent.ItemCraftedEvent
static class
PlayerEvent.ItemPickupEvent
static class
PlayerEvent.ItemSmeltedEvent
static class
PlayerEvent.LoadFromFile
The player is being loaded from the world save.static class
PlayerEvent.NameFormat
NameFormat is fired when a player's display name is retrieved.
This event is fired whenever a player's name is retrieved inEntityPlayer#getDisplayName()
orEntityPlayer#refreshDisplayName()
.
This event is fired via theForgeEventFactory#getPlayerDisplayName(EntityPlayer, String)
.
PlayerEvent.NameFormat.username
contains the username of the player.static class
PlayerEvent.PlayerChangedDimensionEvent
static class
PlayerEvent.PlayerChangeGameModeEvent
Fired when the game type of a server player is changed to a different value than what it was previously.static class
PlayerEvent.PlayerLoggedInEvent
static class
PlayerEvent.PlayerLoggedOutEvent
static class
PlayerEvent.PlayerRespawnEvent
static class
PlayerEvent.SaveToFile
The player is being saved to the world store.static class
PlayerEvent.StartTracking
Fired when an Entity is started to be "tracked" by this player (the player receives updates about this entity, e.g.static class
PlayerEvent.StopTracking
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
PlayerEvent.TabListNameFormat
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 inServerPlayerEntity.getTabListDisplayName()
orServerPlayerEntity.refreshTabListName()
.
This event is fired via theForgeEventFactory.getPlayerTabListDisplayName(PlayerEntity)
.
PlayerEvent.TabListNameFormat.getDisplayName()
contains the display name of the player or null if the client should determine the display name itself.static class
PlayerEvent.Visibility
Deprecated.-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEvent
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private PlayerEntity
entityPlayer
-
Constructor Summary
Constructors Constructor Description PlayerEvent(PlayerEntity player)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlayerEntity
getPlayer()
-
Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
entityPlayer
private final PlayerEntity entityPlayer
-
-
Constructor Detail
-
PlayerEvent
public PlayerEvent(PlayerEntity player)
-
-
Method Detail
-
getPlayer
public PlayerEntity getPlayer()
- Returns:
- Player
-
-