Class ArrowNockEvent

All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent

public class ArrowNockEvent extends PlayerEvent implements net.neoforged.bus.api.ICancellableEvent
ArrowNockEvent is fired when a player begins using a bow.
This event is fired whenever a player begins using a bow in BowItem.use(Level, Player, InteractionHand).

This event is ICancellableEvent. Cancelling the event causes the action to fail with InteractionResult.FAIL.

This event is fired on the NeoForge.EVENT_BUS.

  • Field Details

    • bow

      private final net.minecraft.world.item.ItemStack bow
    • hand

      private final net.minecraft.world.InteractionHand hand
    • level

      private final net.minecraft.world.level.Level level
    • hasAmmo

      private final boolean hasAmmo
    • action

      private net.minecraft.world.InteractionResult action
  • Constructor Details

    • ArrowNockEvent

      public ArrowNockEvent(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack item, net.minecraft.world.InteractionHand hand, net.minecraft.world.level.Level level, boolean hasAmmo)
  • Method Details

    • getBow

      public net.minecraft.world.item.ItemStack getBow()
    • getLevel

      public net.minecraft.world.level.Level getLevel()
    • getHand

      public net.minecraft.world.InteractionHand getHand()
    • hasAmmo

      public boolean hasAmmo()
    • getAction

      public net.minecraft.world.InteractionResult getAction()
    • setAction

      public void setAction(net.minecraft.world.InteractionResult action)