Class ExpandPlayerInteractEvent
java.lang.Object
com.blamejared.crafttweaker.natives.event.interact.ExpandPlayerInteractEvent
This event is the superclass of all other PlayerInteract events.
Generally, you want to use the subtypes of this event.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.core.BlockPosgetBlockPos(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) If the interaction was on an entity, will be a BlockPos centered on the entity.static net.minecraft.world.InteractionResultgetCancellationResult(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) static net.minecraft.core.DirectiongetFace(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) The face involved in this interaction.static net.minecraft.world.InteractionHandgetHand(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) static IItemStackgetItemStack(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) The stack involved in this interaction.static voidsetCancellationResult(net.minecraftforge.event.entity.player.PlayerInteractEvent internal, net.minecraft.world.InteractionResult result) Set the EnumActionResult that will be returned to vanilla if the event is cancelled, instead of calling the relevant method of the event.
-
Constructor Details
-
ExpandPlayerInteractEvent
public ExpandPlayerInteractEvent()
-
-
Method Details
-
getBlockPos
public static net.minecraft.core.BlockPos getBlockPos(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) If the interaction was on an entity, will be a BlockPos centered on the entity. If the interaction was on a block, will be the position of that block. Otherwise, will be a BlockPos centered on the player. -
getItemStack
public static IItemStack getItemStack(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) The stack involved in this interaction. May be empty, but will never be null. -
getFace
public static net.minecraft.core.Direction getFace(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) The face involved in this interaction. For all non-block interactions, this will return null -
getHand
public static net.minecraft.world.InteractionHand getHand(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) -
getCancellationResult
public static net.minecraft.world.InteractionResult getCancellationResult(net.minecraftforge.event.entity.player.PlayerInteractEvent internal) - Returns:
- The EnumActionResult that will be returned to vanilla if the event is cancelled, instead of calling the relevant method of the event. By default, this is PASS, meaning cancelled events will cause the client to keep trying more interactions until something works.
-
setCancellationResult
public static void setCancellationResult(net.minecraftforge.event.entity.player.PlayerInteractEvent internal, net.minecraft.world.InteractionResult result) Set the EnumActionResult that will be returned to vanilla if the event is cancelled, instead of calling the relevant method of the event. Note that this only has an effect on RightClickBlockEvent, RightClickItemEvent, EntityInteractEvent.
-