类 BlockEvent.BreakEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.BlockEvent.BreakEvent
所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
封闭类:
BlockEvent

public static class BlockEvent.BreakEvent extends BlockEvent implements net.neoforged.bus.api.ICancellableEvent
This event is fired on the server when a player attempts to break a block, upon receipt of a block break packet. The following conditions may cause this event to fire in a cancelled state: In the first two cases, un-cancelling the event will not permit the block to be broken. In the third case, un-cancelling will allow the break, bypassing the behavior of
引用无效
Item#canAttackBlock
.
  • 字段详细资料

    • player

      private final Player player
  • 构造器详细资料

  • 方法详细资料

    • getPlayer

      public Player getPlayer()
      返回 the player who is attempting to break the block。
      返回:
      the player who is attempting to break the block
    • setCanceled

      public void setCanceled(boolean canceled)
      Cancelling this event will prevent the block from being broken, and notifies the client of the refusal.
      指定者:
      setCanceled 在接口中 net.neoforged.bus.api.ICancellableEvent