Class InventoryHitCheck

java.lang.Object
org.samo_lego.golfiv.event.combat.InventoryHitCheck
All Implemented Interfaces:
net.fabricmc.fabric.api.event.player.AttackEntityCallback, net.fabricmc.fabric.api.event.player.UseEntityCallback

public class InventoryHitCheck extends Object implements net.fabricmc.fabric.api.event.player.UseEntityCallback, net.fabricmc.fabric.api.event.player.AttackEntityCallback
  • Field Summary

    Fields inherited from interface net.fabricmc.fabric.api.event.player.AttackEntityCallback

    EVENT

    Fields inherited from interface net.fabricmc.fabric.api.event.player.UseEntityCallback

    EVENT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.util.ActionResult
    interact(net.minecraft.entity.player.PlayerEntity player, net.minecraft.world.World world, net.minecraft.util.Hand hand, net.minecraft.entity.Entity entity, @Nullable net.minecraft.util.hit.EntityHitResult hitResult)
    Checks whether player is trying to hit an entity while having open inventory.

    Methods inherited from class java.lang.Object

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

    • InventoryHitCheck

      public InventoryHitCheck()
  • Method Details

    • interact

      public net.minecraft.util.ActionResult interact(net.minecraft.entity.player.PlayerEntity player, net.minecraft.world.World world, net.minecraft.util.Hand hand, net.minecraft.entity.Entity entity, @Nullable @Nullable net.minecraft.util.hit.EntityHitResult hitResult)
      Checks whether player is trying to hit an entity while having open inventory.
      Specified by:
      interact in interface net.fabricmc.fabric.api.event.player.AttackEntityCallback
      Specified by:
      interact in interface net.fabricmc.fabric.api.event.player.UseEntityCallback
      Parameters:
      player - player trying to interact with entity.
      Returns:
      ActionResult.FAIL if player shouldn't be able to hit the victim, otherwise ActionResult.PASS