类 EntityTargetLivingEntityEvent

所有已实现的接口:
Cancellable

public class EntityTargetLivingEntityEvent extends EntityTargetEvent
当实体 targeting 一个 LivingEntity 且只能 targeting 生物实体时调用。
  • 构造器详细资料

  • 方法详细资料

    • getTarget

      @Nullable public @Nullable LivingEntity getTarget()
      从类复制的说明: EntityTargetEvent
      获取此实体正在 targeting 的实体。

      在事件因生物忘记其目标而被调用时,此值将为 null。

      原文: Get the entity that this is targeting.

      This will be null in the case that the event is called when the mob forgets its target.

      覆盖:
      getTarget 在类中 EntityTargetEvent
      返回:
      实体
    • setTarget

      public void setTarget(@Nullable @Nullable Entity target)
      设置你希望生物 targeting 的实体。

      可以设置为 null,null 会导致实体没有目标。

      必须是 LivingEntity 或 null。

      原文: Set the Entity that you want the mob to target.

      It is possible to be null, null will cause the entity to be target-less.

      Must be a LivingEntity, or null.

      覆盖:
      setTarget 在类中 EntityTargetEvent
      参数:
      target - 要 targeting 的实体