Block API

Extensions giving blocks more functionality.

Setup

repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-block-api:<VERSION>'
}

CreoBlock

CreoBlock.java
// Called when an entity is looking at the block.
void onLookedAt(World world, BlockState state, BlockHitResult hitResult, Entity looker, double squaredDistance);

// Called when a block is placed by a structure block, after data structure blocks have been processed.
void onPlacedByStructure(ServerWorldAccess world, BlockPos pos, BlockState state, FluidState fluidState, Random random, BlockPos pivot, StructureTemplate structureTemplate, StructurePlacementData placementData, StructureTemplate.StructureBlockInfo structureBlockInfo);

// Determines whether CreoBlock#onAdjacentEntityCollision can be called.
boolean canEntityCollideAdjacent(Entity entity, BlockState state, BlockPos pos);

// Called when an entity is next to a block but not actually colliding with it.
void onAdjacentEntityCollision(Entity entity, BlockState state, BlockPos pos);

// Called client-side to render a blockstate as an overlay to the block.
BlockState getOverlayState(BlockState state, BlockPos pos, Random random);

Spreadable

Last updated