Class WallHitCheck

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

public class WallHitCheck extends Object implements net.fabricmc.fabric.api.event.player.AttackEntityCallback, net.fabricmc.fabric.api.event.player.UseEntityCallback
  • 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 there's a block between a player and entity the player is trying to interact with.

    Methods inherited from class java.lang.Object

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

    • WallHitCheck

      public WallHitCheck()
  • 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 there's a block between a player and entity the player is trying to interact with.
      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