类 AttackEntityEvent

所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent

public class AttackEntityEvent extends PlayerEvent implements net.neoforged.bus.api.ICancellableEvent
AttackEntityEvent is fired when a player attacks an Entity.
This event is fired whenever a player attacks an Entity in Player.attack(Entity).

target contains the Entity that was damaged by the player.

This event is ICancellableEvent.
If this event is canceled, the player does not attack the Entity.

This event does not have a result.
引用无效
HasResult


This event is fired on the NeoForge.EVENT_BUS.
  • 字段详细资料

    • target

      private final Entity target
  • 构造器详细资料

    • AttackEntityEvent

      public AttackEntityEvent(Player player, Entity target)
  • 方法详细资料

    • getTarget

      public Entity getTarget()