Class BlockEvent.BlockToolInteractEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
Enclosing class:
BlockEvent

@Deprecated(forRemoval=true, since="1.18.2") public static class BlockEvent.BlockToolInteractEvent extends BlockEvent.BlockToolModificationEvent
Deprecated, for removal: This API element is subject to removal in a future version.
Use BlockEvent.BlockToolModificationEvent and put world-modifying actions behind if (!event.isSimulated()).
Fired when a block is right-clicked by a tool to change its state. For example: Used to determine if an axe can strip, a shovel can path, or a hoe can till.

This deprecated subclass event is only fired when BlockEvent.BlockToolModificationEvent.isSimulated() is false. To receive simulated events, use BlockEvent.BlockToolModificationEvent.

This event is Cancelable. If canceled, this will prevent the tool from changing the block's state.

  • Field Details

    • player

      private final Player player
      Deprecated, for removal: This API element is subject to removal in a future version.
    • stack

      private final ItemStack stack
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • BlockToolInteractEvent

      public BlockToolInteractEvent(BlockState originalState, @Nonnull UseOnContext context, ToolAction toolAction)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • BlockToolInteractEvent

      public BlockToolInteractEvent(LevelAccessor world, BlockPos pos, BlockState originalState, Player player, ItemStack stack, ToolAction toolAction)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details