Data

public final class Data(source)

Details about an interaction.

Parameters

player

The interacting player

world

The world the interaction happened in. Must be client world

hand

The player's interacting hand

extra

Extra properties to supply to the filters. Can be mutable

blockEntity

The target block entity. Is null, if entity is not null

entity

The target entity. Is null, if blockEntity is not null

Constructors

Link copied to clipboard
public Interaction.Data Interaction.Data(PlayerEntity player, World world, Hand hand, HitResult hitResult, Object extra, BlockEntity blockEntity, Entity entity)

Properties

Link copied to clipboard
private final BlockEntity blockEntity
Link copied to clipboard
private final Entity entity
Link copied to clipboard

Gets entity if not null, or the entity player is sitting on. Preferred over entity.

Link copied to clipboard
private final Object extra
Link copied to clipboard
private final Hand hand
Link copied to clipboard
private final HitResult hitResult
Link copied to clipboard
private final PlayerEntity player
Link copied to clipboard
private final World world

Functions

Link copied to clipboard
public final BlockEntity getBlockEntity()
Link copied to clipboard
public final Entity getEntity()
Link copied to clipboard
Link copied to clipboard
public final Object getExtra()
Link copied to clipboard
public final Hand getHand()
Link copied to clipboard
public final HitResult getHitResult()
Link copied to clipboard
public final PlayerEntity getPlayer()
Link copied to clipboard
public final World getWorld()