Class ExpandPlayerInteractEvent

java.lang.Object
com.blamejared.crafttweaker.natives.event.interact.ExpandPlayerInteractEvent

@ZenRegister public class ExpandPlayerInteractEvent extends Object
This event is the superclass of all other PlayerInteract events. Generally, you want to use the subtypes of this event.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static net.minecraft.world.InteractionResult
    getCancellationResult(net.minecraftforge.event.entity.player.PlayerInteractEvent internal)
     
    static net.minecraft.core.Direction
    getFace(net.minecraftforge.event.entity.player.PlayerInteractEvent internal)
    The face involved in this interaction.
    static net.minecraft.world.InteractionHand
    getHand(net.minecraftforge.event.entity.player.PlayerInteractEvent internal)
     
    static IItemStack
    getItemStack(net.minecraftforge.event.entity.player.PlayerInteractEvent internal)
    The stack involved in this interaction.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.