Class InteractBlockEmptyHandEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
org.moddingx.libx.event.InteractBlockEmptyHandEvent

public class InteractBlockEmptyHandEvent extends net.minecraftforge.eventbus.api.Event
Fired on right click with an empty hand but after the block action was processed. If this is not canceled, InteractionResult.PASS is returned from the click. If this is canceled, the value of cancellationResult is returned. This is only fired on the server. IMPORTANT: Canceling this with InteractionResult.CONSUME for the main hand does not mean it won't be posted for the offhand. For this cancel PlayerInteractEvent.RightClickBlock on the client. Returning InteractionResult.SUCCESS will swing the arm. However, it will first try to propagate to the offhand. So in order to swing the main hand, the event for the main hand has to return InteractionResult.SUCCESS and for the offhand InteractionResult.PASS.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    InteractBlockEmptyHandEvent(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.level.Level level, net.minecraft.world.InteractionHand hand, net.minecraft.world.phys.BlockHitResult hit)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.InteractionResult
     
    net.minecraft.world.InteractionHand
     
    net.minecraft.world.phys.BlockHitResult
     
    net.minecraft.world.level.Level
     
    net.minecraft.server.level.ServerPlayer
     
    boolean
     
    void
    setCancellationResult(net.minecraft.world.InteractionResult cancellationResult)
     

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InteractBlockEmptyHandEvent

      public InteractBlockEmptyHandEvent(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.level.Level level, net.minecraft.world.InteractionHand hand, net.minecraft.world.phys.BlockHitResult hit)
  • Method Details

    • getPlayer

      public net.minecraft.server.level.ServerPlayer getPlayer()
    • getLevel

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

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

      public net.minecraft.world.phys.BlockHitResult getHit()
    • getCancellationResult

      public net.minecraft.world.InteractionResult getCancellationResult()
    • setCancellationResult

      public void setCancellationResult(net.minecraft.world.InteractionResult cancellationResult)
    • isCancelable

      public boolean isCancelable()
      Overrides:
      isCancelable in class net.minecraftforge.eventbus.api.Event