# 类的使用
org.bukkit.event.entity.EntityEvent

使用EntityEvent的程序包
程序包
说明
org.bukkit.event.entity
与`实体`相关的`事件`，不包括 一些直接引用的更具体的实体类型.
org.bukkit.event.player
与`玩家`相关的`事件`.

- ## org.bukkit.event.entity中EntityEvent的使用

  org.bukkit.event.entity中EntityEvent的子类
  修饰符和类型
  类
  说明
  `class`
  `AreaEffectCloudApplyEvent`
  当滞留药水应用它的效果时触发本事件，期间每5 tick发生一次。
  `class`
  `ArrowBodyCountChangeEvent`
  当箭矢射进实体或从实体上拔出(脱落)时触发本事件.
  `class`
  `BatToggleSleepEvent`
  当一只蝙蝠将要睡觉或醒来时触发本事件.
  `class`
  `CreatureSpawnEvent`
  当一个生物体在世界中出生时触发该事件.
  `class`
  `CreeperPowerEvent`
  当爬行者被闪电击中时触发该事件.
  `class`
  `EnderDragonChangePhaseEvent`
  Called when an EnderDragon switches controller phase.
  `class`
  `EntityAirChangeEvent`
  当实体的氧气值发生变化时触发本事件
  `class`
  `EntityBreakDoorEvent`
  当`实体`破坏门时触发本事件.
  `class`
  `EntityBreedEvent`
  当一个实体与另一个实体交配繁殖时触发本事件.
  `class`
  `EntityChangeBlockEvent`
  Called when any Entity changes a block and a more specific event is not available.
  `class`
  `EntityCombustByBlockEvent`
  当方块造成实体燃烧时触发该事件.
  `class`
  `EntityCombustByEntityEvent`
  当一个实体造成另外一个实体燃烧时触发该事件.
  `class`
  `EntityCombustEvent`
  当实体燃烧时触发该事件
  `class`
  `EntityCreatePortalEvent`
  已过时。
  请使用 `PortalCreateEvent`
  `class`
  `EntityDamageByBlockEvent`
  当一个实体受到来自方块的伤害时触发该事件
  `class`
  `EntityDamageByEntityEvent`
  当一个实体受到另外一个实体伤害时触发该事件
  `class`
  `EntityDamageEvent`
  储存伤害事件的数据
  `class`
  `EntityDeathEvent`
  当一个实体死亡时触发本事件
  `class`
  `EntityDismountEvent`
  Called when an entity stops riding another entity.
  `class`
  `EntityDropItemEvent`
  Thrown when an entity creates an item drop.
  `class`
  `EntityEnterBlockEvent`
  当`实体`进入方块, 保存到那个方块时触发本事件.
  `class`
  `EntityEnterLoveModeEvent`
  当实体进入求爱模式时触发本事件.
  `class`
  `EntityExhaustionEvent`
  Called when a human entity experiences exhaustion.
  `class`
  `EntityExplodeEvent`
  当一个实体爆炸的时候触发本事件
  `class`
  `EntityInteractEvent`
  当一个实体与其他物体互交时触发本事件
  `class`
  `EntityKnockbackByEntityEvent`
  Called when an entity receives knockback from another entity.
  `class`
  `EntityKnockbackEvent`
  Called when a living entity receives knockback.
  `class`
  `EntityMountEvent`
  Called when an entity attempts to ride another entity.
  `class`
  `EntityPickupItemEvent`
  当实体捡起地面上的掉落物时触发本事件.
  `class`
  `EntityPlaceEvent`
  当一个实体因玩家在一个方块上"放置"一物品而创建时触发本事件.
  `class`
  `EntityPortalEnterEvent`
  当一个实体与传送门接触时触发本事件.
  `class`
  `EntityPortalEvent`
  当一个非玩家的实体被传送门传送时触发本事件
  `class`
  `EntityPortalExitEvent`
  在实体退出传送门前触发本事件.
  `class`
  `EntityPoseChangeEvent`
  当实体改变它的姿态时触发本事件.
  `class`
  `EntityPotionEffectEvent`
  当实体上的药水效果发生改变时触发本事件.
  `class`
  `EntityRegainHealthEvent`
  当实体恢复生命值时触发本事件.
  `class`
  `EntityRemoveEvent`
  Called when an `Entity` is removed.
  `class`
  `EntityResurrectEvent`
  当实体死亡并且有机会复活时触发本事件.
  `class`
  `EntityShootBowEvent`
  Called when a LivingEntity shoots a bow firing an arrow
  `class`
  `EntitySpawnEvent`
  当实体生成于世界内时触发本事件.
  `class`
  `EntitySpellCastEvent`
  Called when a `Spellcaster` casts a spell.
  `class`
  `EntityTameEvent`
  当生物实体被驯服时触发本事件.
  `class`
  `EntityTargetEvent`
  Called when a creature targets or untargets another entity
  `class`
  `EntityTargetLivingEntityEvent`
  Called when an Entity targets a `LivingEntity` and can only target LivingEntity's.
  `class`
  `EntityTeleportEvent`
  当非玩家实体从一处传送到另一处时触发本事件.
  `class`
  `EntityToggleGlideEvent`
  Sent when an entity's gliding status is toggled with an Elytra.
  `class`
  `EntityToggleSwimEvent`
  当实体游泳状态改变时触发本事件.
  `class`
  `EntityTransformEvent`
  当实体将转化/蜕变为其它实体时触发本事件.
  `class`
  `EntityUnleashEvent`
  Called immediately prior to an entity being unleashed.
  `class`
  `ExpBottleEvent`
  Called when a ThrownExpBottle hits and releases experience.
  `class`
  `ExplosionPrimeEvent`
  Called when an entity has made a decision to explode.
  `class`
  `FireworkExplodeEvent`
  当烟花爆炸时触发本事件
  `class`
  `FoodLevelChangeEvent`
  当一个人类实体的饥饿值发生变化时触发本事件
  `class`
  `HorseJumpEvent`
  当马跳起时调用此事件.
  `class`
  `ItemDespawnEvent`
  当`掉落物`存在时间超过5分钟后被移除时触发本事件 (注:掉落物存在时间因服务器配置和安装的插件而异).
  `class`
  `ItemMergeEvent`
  `class`
  `ItemSpawnEvent`
  当掉落物生成于某个世界时触发本事件.
  `class`
  `LingeringPotionSplashEvent`
  Called when a splash potion hits an area
  `class`
  `PiglinBarterEvent`
  Stores all data related to the bartering interaction with a piglin.
  `class`
  `PigZapEvent`
  Stores data for pigs being zapped
  `class`
  `PigZombieAngerEvent`
  Called when a Pig Zombie is angered by another entity.
  `class`
  `PlayerDeathEvent`
  当一个`玩家`死亡时触发本事件
  `class`
  `PotionSplashEvent`
  Called when a splash potion hits an area
  `class`
  `ProjectileHitEvent`
  Called when a projectile hits an object
  `class`
  `ProjectileLaunchEvent`
  当一个抛射物被发射时触发本事件.
  `class`
  `SheepDyeWoolEvent`
  当羊身上的毛被染色时触发本事件.
  `class`
  `SheepRegrowWoolEvent`
  当羊身上的羊毛重新长出时触发本事件.
  `class`
  `SlimeSplitEvent`
  当史莱姆死亡后分裂成小史莱姆时触发本事件
  `class`
  `SpawnerSpawnEvent`
  当刷怪笼刷出实体时触发本事件.
  `class`
  `StriderTemperatureChangeEvent`
  Called when a `Strider`'s temperature has changed as a result of entering or exiting blocks it considers warm.
  `class`
  `TrialSpawnerSpawnEvent`
  Called when an entity is spawned into a world by a trial spawner.
  `class`
  `VillagerAcquireTradeEvent`
  Called whenever a villager acquires a new trade.
  `class`
  `VillagerCareerChangeEvent`
  `class`
  `VillagerReplenishTradeEvent`
  Called when a `Villager` is about to restock one of its trades.

- ## org.bukkit.event.player中EntityEvent的使用

  org.bukkit.event.player中EntityEvent的子类
  修饰符和类型
  类
  说明
  `class`
  `PlayerUnleashEntityEvent`
  当一个实体被玩家解开拴绳时调用.