Enum Class UseItemOnBlockEvent.UsePhase

java.lang.Object
java.lang.Enum<UseItemOnBlockEvent.UsePhase>
net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent.UsePhase
All Implemented Interfaces:
Serializable, Comparable<UseItemOnBlockEvent.UsePhase>, Constable
Enclosing class:
UseItemOnBlockEvent

public static enum UseItemOnBlockEvent.UsePhase extends Enum<UseItemOnBlockEvent.UsePhase>
  • Enum Constant Details

    • ITEM_BEFORE_BLOCK

      public static final UseItemOnBlockEvent.UsePhase ITEM_BEFORE_BLOCK
      The IItemExtension.onItemUseFirst(ItemStack, UseOnContext) interaction. This is noop/PASS for most items, but some mods' items have interactions here.
    • BLOCK

      public static final UseItemOnBlockEvent.UsePhase BLOCK
      The BlockBehaviour.useItemOn(net.minecraft.world.item.ItemStack, net.minecraft.world.level.block.state.BlockState, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.world.entity.player.Player, net.minecraft.world.InteractionHand, net.minecraft.world.phys.BlockHitResult) interaction. Skipped if the player is sneaking and holding an item that skips the block while sneaking (most items).
    • ITEM_AFTER_BLOCK

      public static final UseItemOnBlockEvent.UsePhase ITEM_AFTER_BLOCK
      The Item.useOn(net.minecraft.world.item.context.UseOnContext) interaction.
  • Constructor Details

    • UsePhase

      private UsePhase()
  • Method Details

    • values

      public static UseItemOnBlockEvent.UsePhase[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UseItemOnBlockEvent.UsePhase valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null