-
Notifications
You must be signed in to change notification settings - Fork 56
Block and Item Interfaces
Small interfaces you implement so other mods' features work on your blocks.
None of these do anything by themselves. They're a shared vocabulary: implement IRecolorable and
any mod's dye sprayer can recolor your block, implement IWashable and Supplementaries' soap works
on it, implement IPistonMotionReact and your block can react to being pushed.
If you're writing a block that does something another mod might want to interact with, look here first before inventing your own hook.
| Interface | Implement when your block |
|---|---|
IRecolorable |
Can be dyed. tryRecolor(level, pos, state, color)
|
IColored |
Has a color to report |
IWashable |
Can be washed clean (soap, water) |
IWaxable |
Can be waxed like copper |
ILightable |
Can be lit and extinguished |
IGlowable |
Can be made to glow (glow ink) |
IFlammable |
Has Forge style flammability that should also apply on Fabric |
IPistonMotionReact |
Needs to react to being pushed or pulled |
IRotatable / IAnalogRotatable
|
Rotates in a non standard way (wrenches, rotation tools) |
IBlockHolder |
Contains another blockstate, like a mimic |
IOptionalEntityBlock |
Only needs a block entity for some states |
IOwnerProtected |
Has an owner and should be protected from others |
IOnePlayerInteractable |
Can only be edited by one player at a time, like a sign |
IEntityCarry / ITileEntityCarry
|
Can be picked up and carried |
IBeeGrowable |
Can be grown by bees, mostly double crops |
ISoftFluidProvider / ISoftFluidConsumer / ISoftFluidTankProvider
|
Holds a soft fluid |
Mostly rendering, see Item Rendering. The odd one out is ILeftClickReact, which
gives an item a left click callback vanilla doesn't have.
A few base classes for things that are annoying to write from scratch: MimicBlock and
MimicBlockTile (a block that renders as another), ItemDisplayTile and
OpenableContainerBlockTile (block entities holding items), ModStairBlock, ModLiquidBlock,
WaterBlock, and DynamicRenderedBlockTile / DynamicRenderedItemDisplayTile.
Basics Platform Helpers Registration Networking Events Configs Config Screen
Resources Runtime Resource Packs Texture Manipulation Resource Helpers Block Set API
Client Custom Models Item Rendering Rendered Textures Post Shaders GUI Toolkit Colors
World Block and Item Interfaces Additional Item Placements Improved Entities Fake Levels World Data Dispenser Behaviors
Utilities Codec Utilities Misc Helpers Commands
Datapacks Villagers Soft Fluids Map Markers Spawn Boxes Global Datapack Folder