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 -
Method Summary
Modifier and TypeMethodDescriptionnet.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.
-
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 interfacenet.fabricmc.fabric.api.event.player.AttackEntityCallback
- Specified by:
interact
in interfacenet.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, otherwiseActionResult.PASS
-