Creoii Mod Documentation & Wiki
Creo API
Creo API
  • Overview
  • Setup
  • Packages
    • Block API
    • Block Injection API
    • Content Modification API
    • Convention Tags
    • Entity Attributes
    • Entity-Block Collision API
    • Events
    • Food Component API
    • Item API
    • Mod Compatibility API
    • Registry API
    • Shader Interaction API
    • Worldgen
Powered by GitBook
On this page
  • Setup
  • CreoBlock
  • Spreadable
  1. Packages

Block API

Extensions giving blocks more functionality.

Setup

repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-block-api:<VERSION>'
}
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

PreviousSetupNextBlock Injection API

Last updated 1 year ago