find

@Nullable()
A find(World world, BlockPos pos, C context)

Attempt to retrieve an API from a block in the world.Consider using BlockApiCache if you are doing frequent queries at the same position.

Note: If the block state or the block entity is known, it is more efficient to use find.

Return

The retrieved API, or {@code null} if no API was found.

Parameters

world

The world.

pos

The position of the block.

context

Additional context for the query, defined by type parameter C.

@Nullable()
abstract A find(World world, BlockPos pos, @Nullable() BlockState state, @Nullable() BlockEntity blockEntity, C context)

Attempt to retrieve an API from a block in the world.Consider using BlockApiCache if you are doing frequent queries at the same position.

Return

The retrieved API, or {@code null} if no API was found.

Parameters

world

The world.

pos

The position of the block.

context

Additional context for the query, defined by type parameter C.

state

The block state at the target position, or null if unknown.

blockEntity

The block entity at the target position if it is known, or null if it is unknown or does not exist.