Class ReachCheck

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

public class ReachCheck 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 victim, @Nullable net.minecraft.util.hit.EntityHitResult hitResult)
    Checks if player is trying to interact with entity while being too far away.

    Methods inherited from class java.lang.Object

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

    • ReachCheck

      public ReachCheck()
  • 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 victim, @Nullable @Nullable net.minecraft.util.hit.EntityHitResult hitResult)
      Checks if player is trying to interact with entity while being too far away.
      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.
      victim - entity player is trying to interact with.
      Returns:
      ActionResult.FAIL if player shouldn't be able to hit the victim, otherwise ActionResult.PASS