Patchwork
Note: this will change frequently, do not use as a primary source; instead reference the source code.

Sounds are stored as OGG files in sounds/.
Extends Item. Base class for tools, weapons, and harvest utilities.
Extends Item. Base class for consumable food items.
Tells other blocks to not cull their faces when touching this block.
This property returns the block's ID. Never hardcode IDs as they are bound to change.
Multipart Blocks are a special blocktype that uses multiple sub-boxes defined by Bounding Boxes.
The global Mixin instance manages hooks, event handling, and method overriding across game objects and mod functions.
Standard mixins made available by Patchwork.

API
Patchwork is a Mod loader for Breakmine. It supports:Sound
static void play(id, volume)Plays a mono sound by ID (format: mod:sfx.ogg)
Sounds are stored as OGG files in sounds/.
Item
constructor(id, textureSlotId = id)Creates a new base item instance and registers it in the Item Registry.
string|null descriptionProperty storing the display name or Tooltip text for the item.
bool isToolProperty flag identifying if the item behaves as a tool or weapon. Defaults to false.
number durabilityProperty storing the maximum durability or durability uses of the item.
string getTextureForFace(face)Returns the texture key or path used when rendering the item in hand, on the GUI, or dropped in the world.
string|null getDescription()Returns the Tooltip description text for the item.
bool isItem()Returns true to identify this object as an Item.
static Item|null getById(itemId)Retrieves a registered Item instance by its numerical ID.
ItemTool
Extends Item. Base class for tools, weapons, and harvest utilities.
constructor(id, textureName, name, material, toolType)Creates a new tool instance with specified material properties, tool type, and auto-calculated durability.
string materialProperty defining the tier material (e.g. 'wood', 'stone', 'iron', 'diamond', 'gold').
string toolTypeProperty defining the Tool Category (e.g. 'pickaxe', 'axe', 'shovel').
number efficiency()Returns the mining speed multiplier based on the tool's material tier.
ItemEdible
Extends Item. Base class for consumable food items.
constructor(id, textureSlotId = id)Creates a new edible item instance.
number healAmountProperty storing the number of health or hunger points restored when consumed.
void onUse(world, x, y, z, itemstack, hitFace)Called when a Player uses or consumes the item.
Block
constructor(id, textureSlotId = id)Creates a new block instance and registers it in the Block Registry.
bool .multipartProperty flag that, when set to true in the constructor, identifies the block as using dynamic multipart geometry instead of a standard single cube.
bool .descriptionSets the block's Tooltip.
int .hardnessSets the block's break speed.
bool .pathWhether to render as a Grass Path or not.
bool .noFaceCullDeprecated, use isTranslucent() instead.
Tells other blocks to not cull their faces when touching this block.
bool .inventoryTabThe inventory tab to add this block to. Defaults to EnumCreativeInventoryTab.BUILDING_BLOCKS.
string .modThe mod name that appears in the Tooltip. Patchwork automatically sets this to the mod's name.
int .idMods shouldn't mess with this.
This property returns the block's ID. Never hardcode IDs as they are bound to change.
Block.sounds .soundSets the block's sound. Currently loaded sounds:
Block.sounds.stone Block.sounds.wood Block.sounds.gravel Block.sounds.grass Block.sounds.cloth Block.sounds.sand Block.sounds.glass Block.sounds.leaves
bool canCastAmbientOcclusion()Returns whether this block can cast Ambient Occlusion on neighboring Blocks.
bool onRender(world, x, y, z, blockRenderer)Called upon render of this Block by Block Renderer; returning true allows for overriding the block's rendering logic.
bool canInteract()Returns whether Players can interact with this Block.
MovingObjectPosition collisionRayTrace(world, x, y, z, start, end)Performs a raytrace against the block's bounding box (or multipart bounding boxes) to calculate collision hits.
bool getAmbientOcclusion()Returns a bool telling the Block Renderer if the block should receive Ambient Occlusion.
BoundingBox getBoundingBox(world, x, y, z)Returns the selection and outline Bounding Box for the block at the specified position.
BoundingBox getCollisionBoundingBox(world, x, y, z)Returns the solid collision Bounding Box for entity collision, or null if non-solid.
number getColor(world, x, y, z, face)Returns the hex color multiplier applied to the specified face during rendering.
string|null getDescription()Returns the Tooltip text for the block.
Array getDrop(world, x, y, z)Returns an array containing the dropped item ID and quantity when broken (defaults to [id, 1]).
number getHardness()Returns the base breaking Hardness of the Block in ticks.
number getId()Returns the numerical ID of the Block.
number getLightValue()Returns the Light level emitted by this Block (0–15).
Array|null getModel(world, x, y, z)Returns the default array of static block components and Bounding Box definitions for rendering.
Array|null getMultipart(world, x, y, z)Returns dynamic Multipart definitions and Bounding Box arrays based on surrounding world state (e.g. adjacent connecting blocks). If world is null, typically falls back to getModel().
number getOpacity()Returns the Light opacity value of the Block (1.0 for opaque, 0.0 for fully transparent).
number getParticleColor(world, x, y, z)Returns the color tint applied to breaking Particles.
EnumBlockFace getParticleTextureFace()Returns which face Texture is used for Block Particles.
string|null getPreferredToolType()Returns the preferred Tool Category required to efficiently mine this Block.
BlockRenderType getRenderType()Returns the rendering model type used by the Block Renderer.
BlockSound getSound()Returns the sound set used for stepping, placing, and breaking the Block.
string getTextureForFace(face, data, x, y, z, world)Returns the Texture key or path for a specific Block face.
number getTransparency()Returns the transparency level of the Block.
number handHardnessMultiplier()Returns the break speed multiplier applied when breaking without Tools.
bool isHalf(world, x, y, z)DEPRECATED Returns whether the block occupies half height (like slabs).
bool isItem()Returns whether the block is treated as a pure Item representation.
bool isLava()Returns whether the Block behaves as Lava.
bool isLiquid()Returns whether the Block is a Liquid.
bool isReplaceable(world, x, y, z)Returns whether this Block can be overwritten when placing another Block at its position.
bool isSolid()Returns whether the Block is Solid for collision and pathfinding.
bool isTranslucent()Returns whether Light can pass through this Block.
bool isVecInsideXYBounds(point, bbox = null)Checks if a vector position falls within the X and Y bounds of the Bounding Box.
bool isVecInsideXZBounds(point, bbox = null)Checks if a vector position falls within the X and Z bounds of the Bounding Box.
bool isVecInsideYZBounds(point, bbox = null)Checks if a vector position falls within the Y and Z bounds of the Bounding Box.
number|null minimumToolLevel()Returns the minimum Tool Tier Level required to drop Items when broken.
void onBlockAdded(world, x, y, z)Called when the Block is placed or added into the world.
void onBlockPlaced(world, x, y, z, face)Called when the Player places the block against a specific Block face.
bool onMouseButton(world, x, y, z, button)Called when a mouse click occurs on the Block.
void onUse(world, x, y, z, itemstack)Called when a Player right-clicks an Item.
MovingObjectPosition raytraceBoundingBox(bbox, x, y, z, start, end)Helper method to perform raytracing against a specific Bounding Box relative to world coordinates.
Block setHardness(hardness)Sets the Block hardness and returns this for chaining.
bool shouldRenderFace(world, x, y, z, face)Returns whether the specified face should be rendered.
static Block|null getById(typeId)Retrieves a registered Block instance by its ID.
Multipart
Multipart Blocks are a special blocktype that uses multiple sub-boxes defined by Bounding Boxes.
array getMultipart(world, x, y, z)Returns the multipart definition, formatted like this:
["block", <id>, <bbox>] // for defining a multipart cube via block ID. ["blockClass", <id>, <bbox>] // for defining a multipart cube via custom block class.
World
constructor(minecraft)Creates a new World instance, setting up Entity list, light update queues, block tick queues, and atmosphere elements.
void addEntity(entity)
Adds an Entity to the World, assigns an ID if needed, and initializes its renderer.
bool blockExists(x, y, z)
Checks whether a block coordinate is within valid World height bounds and in a loaded Chunk.
number calculateSkylightSubtracted(partialTicks)
Calculates the reduction in skylight brightness based on time of day.
bool chunkExists(chunkX, chunkZ)
Returns whether a Chunk exists at the given chunk coordinates.
void clearChunks()
Clears all Chunks via the ChunkProvider.
void clearEntities()
Removes all Entity instances currently active in the World.
void cleanup()
Cleans up World timers and resources like light update intervals.
number getBlockAt(x, y, z)
Returns the numerical ID of the Block at the specified position.
number getBlockAtFace(x, y, z, face)
Returns the ID of the Block adjacent to the given position on the specified face offset.
Array<BoundingBox> getBlockCollisionBoxesAt(x, y, z)Gets a list of BoundingBox instances contributing to solid physics collision at a specific block coordinate.
number getBlockDataAt(x, y, z)
Returns the metadata value associated with the Block at the given coordinate.
number getCelestialAngle(partialTicks)
Calculates the current celestial rotation (sun/moon position) for rendering and light levels.
Chunk|null getChunkAt(x, z)Gets the Chunk instance at the specified chunk grid coordinates.
ChunkSection|null getChunkAtBlock(x, y, z)Gets the specific 16x16x16 ChunkSection at world block coordinates.
ChunkProvider getChunkProvider()Returns the current ChunkProvider attached to the World.
ChunkSection|null getChunkSectionAt(chunkX, layerY, chunkZ)Returns the ChunkSection at specific chunk coordinates and Y-layer index.
Array<BoundingBox> getCollisionBoxes(region)Gets all colliding BoundingBox instances from solid blocks overlapping with the specified bounding box region.
Entity|null getEntityById(id)Retrieves an active Entity by its unique ID.
Vector3 getFogColor(partialTicks)Calculates the current fog color based on the time of day and celestial angle.
number getHeightAt(x, z)
Gets the world height position of the first non-solid Block at the specified X/Z column.
number getHighestBlockAt(x, z)
Gets the Y position of the highest solid Block at the given X/Z coordinate.
number getHumidity(x, y, z)
Returns the climate humidity value for the specified world location.
number getLightBrightness(x, y, z)
Gets normalized brightness level (0.1 to 1.0) at the specified block coordinate.
number getLightBrightnessForEntity(entity)
Gets normalized brightness level (0.1 to 1.0) at an Entity's current position.
number getSavedLightValue(sourceType, x, y, z)
Gets raw saved light level (0–15) for a specific light source type (EnumSkyBlock.SKY or EnumSkyBlock.BLOCK).
number getSeed()
Returns the seed value for world generation.
Vector3 getSkyColor(x, z, partialTicks)Calculates the overall RGB sky color based on time of day and temperature.
Vector3 getSkyColorByTemp(temperature)Translates a temperature value into an RGB sky color tint.
Vector3 getSpawn()Returns the world spawn position as a Vector3.
number getStarBrightness(partialTicks)
Gets the current star visibility brightness for night rendering.
Vector4|null getSunriseSunsetColor(partialTicks)Calculates RGBA color factors for the horizon during sunrise or sunset.
number getTemperature(x, y, z)
Returns the climate temperature at the specified world location.
number getTotalLightAt(x, y, z)
Gets the combined total light level reaching a specific block position.
bool isAboveGround(x, y, z)
Checks whether the specified position is strictly above the highest solid Block in the column.
bool isHalfBlockAt(x, y, z)
Checks whether the Block at the specified coordinate is a half-height block.
bool isHighestBlock(x, y, z)
Checks whether a block position is at or above the highest solid Block in its column.
bool isSolidBlockAt(x, y, z)
Checks whether the Block at the specified position is solid and non-multipart.
bool isTranslucentBlockAt(x, y, z)
Checks whether light can pass through the Block at the specified coordinate.
void loadSpawnChunks()
Pre-loads Chunks surrounding the world spawn point based on view distance settings.
void neighborLightPropagationChanged(sourceType, x, y, z, level)
Notifies light engine when neighbor light sources or opacity state updates.
void onBlockChanged(x, y, z)
Triggers modified chunk flags to re-render nearby blocks when a change occurs.
void onTick()
Runs the main world update tick including entity updates, scheduled block ticks, tile entities, daylight recalculations, and time passage.
void processBlockTicks()
Processes and executes queued block tick events up to the current world time (singleplayer only).
MovingObjectPosition|number|null rayTraceBlocks(from, to, slab = false)Traces a ray between two positions against block collision bounding boxes in the world.
void removeEntityById(id)
Removes an Entity from the World and disposes of associated render elements (meshes, nametags, shadows).
void scheduleBlockTick(x, y, z, delay)
Schedules a block tick callback at a position after a specified number of world tick delays.
void scheduleNeighborTicks(x, y, z)
Schedules block ticks for six adjacent neighbor coordinates.
void setBlockAt(x, y, z, type, data = 0)
Sets the block ID and metadata at a location, triggering placement, removal, tick updates, and chunk re-renders.
void setBlockDataAt(x, y, z, data)
Sets only the metadata state of a Block at a position without changing its ID.
void setChunkProvider(chunkProvider)
Assigns the world's ChunkProvider.
void setLightAt(sourceType, x, y, z, lightLevel)
Sets light values directly for sky or block light channels and marks the chunk to rebuild.
void setModified(minX, minY, minZ, maxX, maxY, maxZ)
Marks affected chunk sections as modified so they can be re-rendered.
void setSpawn(x, z)
Updates the world's spawn position to the top ground layer at (x, z).
void tickBlock(x, y, z)
Triggers the onBlockTick handler for a block at the given position.
bool updateLights()
Processes pending light updates queued in lightUpdateQueue.
void updateLight(sourceType, x1, y1, z1, x2, y2, z2, notifyNeighbor = true)
Queues a light recalculation task across a 3D bounding region.
Mixin Engine
The global Mixin instance manages hooks, event handling, and method overriding across game objects and mod functions.
void registerFunction(key, fn)Registers a standalone global function under a namespaced key (e.g., 'game:setBlockAt').
any callFunction(key, ...args)Executes a registered standalone mixin function along with all applied hooks.
object|function|null apply(targetKey, mixinDef)Applies properties, replacement methods, or execution hooks (before, around, after) to a registered class instance or standalone global function.
void lockFunction(target, methodName)Locks a specific method on an object or a registered global function key to prevent future mixins from overriding or hooking into it.
void register(key, target)Registers a class instance or target dictionary under a namespaced key in the registry.
any get(key)Retrieves a registered target object or class from the mixin registry.
void on(eventKey, handler, priority = 0)Registers a cancellable event listener. Returning false or setting payload.cancelled = true cancels subsequent listeners. Higher priority handlers run first.
void onGuaranteed(eventKey, handler, priority = 0)Registers an event listener that is guaranteed to run even if the event was cancelled by standard listeners. Receives (payload, isCancelled).
bool emit(eventKey, payload)Emits a cancellable event to all registered listeners. Returns true if the event completed without cancellation, or false if cancelled.
void observe(eventKey, callback)Registers a read-only event observer. Receives a frozen, immutable copy of the payload after events are dispatched.
Registered Mixins
Standard mixins made available by Patchwork.
bool|undefined game:teleportEntityPos(eid, x, y, z)Teleports the specified entity to the target coordinates. Returns true if successful.
Object|undefined game:getEntityPos(eid)Returns an object {x, y, z} containing the coordinates of the entity, or undefined if not found.
bool|undefined game:setBlockAt(x, y, z, id)Sets the block ID at the target coordinates.
number|undefined game:getBlockAt(x, y, z)Returns the numerical ID of the block at the target coordinates.
bool|undefined game:setBlockDataAt(x, y, z, data)Sets metadata for the block at the specified coordinate.
number|undefined game:getBlockDataAt(x, y, z)Returns metadata for the block at the specified coordinate.
World|undefined game:getWorld()Returns the active World instance.
Minecraft|undefined game:getGame()Returns the Breakmine instance.
Entity|undefined game:getEntityById(eid)Retrieves an Entity by ID.
Player|undefined game:getPlayer()Returns the local Player entity instance.
Array<string> mod:list()Returns an array of all registered mod IDs.
bool mod:isEnabled(modId)Checks whether a specific mod is currently enabled.
Block|undefined mod:getBlock(modId, blockId)Retrieves a block class instance registered by a mod using its namespaced ID (modId:blockId).
ModLoader|undefined mod:getLoader()Returns the active ModLoader instance.
Mod Structure
/ (mod root) ├─blocks/ ├─items/ ├─sounds/ ├─textures/ ├─ModData.js └─ModLoad.js
ModData.js
export default class ModData {
static NAME = "Name";
static ID = "id";
static AUTHOR = "Player";
static VERSION = "1.0.0";
}
ModLoad.js
export default class ModLoad {
static onLoad(world) {
}
}
blocks/BlockExample.js
import Block from "../Block.js";
export default class BlockExample extends Block {
constructor(id, textureSlotId) {
super(id, textureSlotId);
this.description = "Example Block";
}
getTextureForFace(face) {
switch (face) {
case EnumBlockFace.NORTH:
return 'example_mod:test';
case EnumBlockFace.TOP:
return 'example_mod:test_2';
case EnumBlockFace.BOTTOM:
return 'breakmine:oak_planks';
default:
return 'example_mod:test_3';
}
}
}