API reference / @jsprismarine/block-behaviors
@jsprismarine/block-behaviors
What a block does. @jsprismarine/blocks says what a block is: its components, its states and its place in the palette. Every component factory there returns {}, so all 1477 vanilla blocks resolve with no behavior at all until this package registers one.
A behavior is a named set of handlers over BlockHooks, attached by family rather than by block, so 50 families cover the whole palette. One call wires them up:
import { BehaviorRegistry } from '@jsprismarine/content';
import { type BlockHooks, resolveBlocks } from '@jsprismarine/blocks';
import { registerVanillaBlockBehaviors } from '@jsprismarine/block-behaviors';
const behaviors = new BehaviorRegistry<BlockHooks>();
registerVanillaBlockBehaviors(behaviors, world);
resolveBlocks(definitions.blocks.values(), { behaviors });The vanilla overlay writes each block's family into jsprismarine:behavior, and the selector reads that value when the definition resolves. A later pack can assign a registered family to a block by setting the same component. Definitions without it receive no vanilla behavior, so callers that resolve blocks directly must include the jsprismarine_vanilla overlay when they want vanilla block families.
world is the second argument because a handler has to reach the world and no hook event carries one. It is a BlockWorld, described below.
The world interface
WorldActions is everything a block does to the world, and the whole of what a family may use:
| Group | Methods |
|---|---|
| Blocks | getBlock, setBlock, propertiesOf, lightDampeningOf, flammabilityOf, hasBlockTag, hasSturdyTopFace |
| Items and entities | dropItem, destroyBlock, spawnEntity, removeEntity, entitiesAt |
| Effects | playSound, spawnParticle |
| Scheduling | scheduleTick(position, delay, kind?, priority?), willTickThisTick |
| Block entities | getBlockData, setBlockData |
| Updates | notifyNeighbors, redstonePower, redstoneSignal, redstoneDirectSignal, redstoneConductor, lightLevel |
| Environment and chance | difficulty, weather, isRainingAt, canFireSpreadAround, random, randomInt, randomFloat |
Several of those are there for reasons worth stating. propertiesOf returns another block's jsprismarine:block_properties, which is how the piston and the falling blocks read push_reaction instead of carrying a list. random is on the interface rather than inside the families so a test flammabilityOf reads the resolved state's minecraft:flammable component, so a pack can change fire odds in a permutation. Fire uses the loaded minecraft:infiniburn_* block tags to decide which fuel keeps it burning forever. hasSturdyTopFace lets the host answer from the block's collision shape. destroyBlock is how a family takes a block out that it is not itself: the host raises its onBreak and rolls Java's loot table for it, where this package would otherwise have to guess that the block drops one of itself. It is optional, and a host that leaves it out gets that guess, which is what the test voxel world does. Fire passes drops: false so a burned block leaves no loot while still running its break hook. popBlock is the one rule that uses the default drop behavior, and the piston's popped block, a block that lost its support and a block a falling anvil cleared out of the way all go through it.
lightDampeningOf can read a block state's vanilla minecraft:light_dampening value, so rules can check how much light a cover blocks without treating every support block as opaque. When a host cannot report dampening, the shared rule treats it as unknown and does not convert the ground block.
Scheduled hooks run from the active block state before the engine fallback. Observer pulses, redstone torch burnout, repeater transitions, comparator output updates, and fire spread run through their family hooks. kind selects the block or fluid tick list and defaults to block; water and lava use the fluid list so their family tick shares the engine's existing liquid schedule.
A BlockWorld is a set of dimensions, and at(dimension) returns the WorldActions for one. Each handler receives the actions for its own event's dimension already resolved, so the dimension never appears in a family's code. A server with one world passes singleDimensionWorld(actions).
Nothing here names a server class. The events are structural, the world is an interface, and the package depends on @jsprismarine/blocks, @jsprismarine/content, and @jsprismarine/mapping.
Testing a family
VoxelWorld is a real implementation of the interface over a map of positions, not a mock: writes read back, and every drop, sound, particle, scheduled tick, spawned entity and neighbor notice is recorded in order. bindFamily binds one family to one identifier through the same create path the registry runs, and gives a method per hook, including entityEvent(position, name, source):
const harness = bindFamily(doorFamily, 'minecraft:wooden_door');
harness.dimension.set({ x: 0, y: 0, z: 0 }, 'minecraft:stone');
harness.dimension.set({ x: 0, y: 1, z: 0 }, 'minecraft:wooden_door', { open_bit: false });
harness.interact({ x: 0, y: 1, z: 0 });
harness.dimension.stateAt({ x: 0, y: 1, z: 0 }, 'open_bit'); // trueheldItem and silkTouchTool build the HookItem the hooks carry, so a test for waxing, shearing or silk touch names an item the same way a server passes one:
harness.interact(position, { itemStack: heldItem('minecraft:honeycomb') });
harness.breakBlock(position, { itemStack: silkTouchTool() });
harness.place(position, { face: 'north', faceLocation: { x: 0.5, y: 0.9, z: 0 } });Both ship in the published package, because a plugin writing its own family wants the same harness.
The held item and the clicked face
onPlace, onBreak and onPlayerInteract carry itemStack, a HookItem with an identifier and a component reader, and onPlace carries the clicked face and faceLocation as well. Together they are what lets a block behavior answer a question about the hand rather than deferring it:
| What the item decides | Where |
|---|---|
| Honeycomb waxes copper, an axe scrapes it | copper, slab, double_slab, stairs, fence, lantern, door, trapdoor |
| Honeycomb seals a sign against edits | sign |
| Silk touch takes glass and ice whole | glass, ice |
| Shears or silk touch take leaves, vines and lichens whole | leaves, climbing |
| A bucket or a bottle fills and empties | cauldron, liquid |
| Flint and steel lights it | candle, furnace (the campfire), redstone (TNT) |
| The clicked face gives a pillar its axis | log |
| The click position gives a slab its half and a stair its flip | slab, stairs |
rules/heldItem.ts owns the item questions and rules/placement.ts the placement ones, so an item name or an enchantment id is written down once. Neither imports @jsprismarine/items: a HookItem is whatever the server hands the hook, and that package's ItemStack satisfies the interface structurally.
The interaction hook also receives whether the player was sneaking. Sneaking with a placeable block skips the block hook so the block can be placed against a chest or door. Other items reach the hook: a copper door opens before an axe can scrape it normally, while sneaking lets the same axe scrape it.
The shared rules
Reusable decisions live in src/rules/ and the families compose them. Copper weathering is the clearest case: identifier rules send a copper door to jsprismarine:door and a copper slab to jsprismarine:slab, so six families run the same random tick.
| Rule | What it decides |
|---|---|
support | Whether a block holds another up, and what popping one does |
gravity | Which blocks fall, and one step of a fall |
weathering | Reading a copper name into wax, oxidation and shape, and writing it back |
connection | The fence, pane and wall connection states |
stairShape | minecraft:corner from the stairs in front and behind |
redstone | Power, wire fading and the pulse lengths |
piston | What a push moves, breaks or refuses, read off push_reaction |
fluid | Spread depth and rate, and the stone, cobblestone and obsidian reactions |
container | Slot counts and the comparator's fill-level formula |
growth | Crop chance from farmland moisture, and the leaf distance search |
light | Whether a block state dampens more light than a supplied cutoff |
heldItem | What the item in the hand is: an axe, shears, honeycomb, an igniter, a bucket, a bottle, silk touch |
placement | What the clicked face and the click position say: a pillar's axis, a slab's half |
portal | Java's PortalShape frame scan, the end portal frame ring, where a new nether portal goes and what it writes, the End platform, and the piglin spawn roll |
Values come from the block
Where a behavior needs a number, it reads it off the block rather than carrying its own copy. jsprismarine:block_properties is the source for push_reaction (the piston and the falling blocks), requires_correct_tool (the drop rule) and random_tick. Reading it goes through the component factory in @jsprismarine/blocks, so an absent component reads as that schema's defaults and a malformed one does too rather than failing the load. friction is published for the movement code and no family reads it, because friction is a decision the entity makes, not the block. Families emit candidate drops. The content break host checks requires_correct_tool against the held item's minecraft:tool rules and merged block tags before releasing loot or family drops.
The state names are the palette's. geometry.test.ts checks CARDINAL_DIRECTIONS against the captured palette's minecraft:cardinal_direction domain, and rules/weathering.test.ts walks every copper block in the palette and asserts that each name the three transitions produce is a block that exists.
Portals
rules/portal.ts is the block half of portals: the pure geometry over WorldActions, with the constants Java's PortalShape, PortalForcer and EndPlatformFeature use. portalFamily calls it from four hooks.
| Hook | Block | What happens |
|---|---|---|
onPlace | fire, soul_fire | findEmptyPortalShape scans both axes for an obsidian frame around the fire, 2 to 21 interior blocks wide and 3 to 21 tall with the corners unchecked, and lightNetherPortal writes minecraft:portal with the frame's portal_axis into the interior. Nothing lights in minecraft:the_end. |
onNeighborChanged | portal | When the neighbor on a vertical face or a face along the portal's axis is neither portal nor obsidian, collapseNetherPortal clears every portal block connectedPortalBlocks reaches through the plane, in one go. |
onPlayerInteract | end_portal_frame | After the eye goes in, findEndPortalRing looks for the flat ring of twelve frames, each with an eye and facing the center, and activateEndPortal fills the 3 by 3 with end_portal. The answer reports that the click cost the eye, which the dispatching server spends from the hand outside creative. |
onRandomTick | portal | In the Overworld, piglinSpawnRoll is random() * 2000 < difficultyId, and a hit spawns minecraft:zombie_pigman beside the bottom of the portal: south of a portal on the x axis, east of one on the z axis. |
Two more functions are for the server's travel code rather than for a hook. portalCreationSite is Java's search for where a new portal goes: every column within 16 blocks of the target, a replaceable run on a solid floor with room for the 4 by 5 frame, the footprint plus a block on each side in the first pass and the footprint alone in the second, closest by 3D distance. When nothing fits the site is forced one block back from the target with y clamped to [70, maxY - 10]. writeNetherPortal writes the frame with corners and six portal blocks, and for a forced site an obsidian platform with four netherrack blocks on each side as Bedrock does. writeEndPlatform writes the 5 by 5 obsidian platform and three rows of air above it, destroying what is in the way.
The block list comes from PORTAL_BLOCK_NAMES in @jsprismarine/blocks, which is the same list the jsprismarine:portal family rule matches on, so the family and the geometry agree on what a portal, a frame and a fire are.
The families
50 names, 49 of them with palette blocks, 1477 blocks. The count is how many palette blocks the family rule in @jsprismarine/blocks sends to it, which matches vanilla_overlay/report.json. registry.test.ts fails when a name in BLOCK_BEHAVIOR_NAMES has no behavior, so the table cannot go stale.
| Family | Blocks | Hooks | What it does |
|---|---|---|---|
plain_block | 199 | onBreak | A full cube that proposes itself as a drop; the content break host applies the correct-tool rule. |
inert | 202 | none | No hooks. The engine and editor blocks whose behavior is not a block behavior. |
slab | 109 | onPlace, onBreak, onRandomTick, onPlayerInteract | Takes its half from where the click landed, merges with the slab it replaced into the double block, waxes and scrapes, and oxidizes when it is copper. |
stairs | 97 | onPlace, onBreak, onNeighborChanged, onRandomTick, onPlayerInteract | Turns to the placer, flips upside down for a click in the upper half, recomputes minecraft:corner on placement and on every neighbor change, and oxidizes when it is copper. |
double_slab | 93 | onBreak, onRandomTick, onPlayerInteract | Drops two of the slab it is made of, waxes and scrapes, and oxidizes when it is copper. |
copper | 84 | onBreak, onRandomTick, onPlayerInteract, onRedstoneUpdate | Waxes with honeycomb, scrapes with an axe, and oxidizes a stage per random tick at the isolated-block rate. |
bamboo | 54 | onBreak, onNeighborChanged, onRandomTick, onTick | Grows a stalk upward to its height limit, takes every block above with it when it breaks, and kills coral that is not in water. |
log | 48 | onPlace, onBreak | Takes pillar_axis from the face the placement was made against, falling back to the placer, and drops itself. |
utility | 47 | onPlace, onBreak, onNeighborChanged, onTick, onStepOn, onEntityFallOn | Counts a beacon pyramid, falls when it is an anvil, runs the spawner timer, and hurts an entity standing on magma. The screens the workstations open belong to the item runtime. |
flora | 47 | onBreak, onNeighborChanged, onStepOn | Pops without soil below, keeps the two halves of a tall plant together, and marks an entity that walks into a wither rose. The effect itself is the entity runtime. |
sign | 39 | onPlace, onBreak, onNeighborChanged, onPlayerInteract | Keeps the sign text in a block entity, seals it against edits when honeycomb waxes it, and pops a wall sign whose backing block goes. |
soil | 39 | onPlace, onBreak, onNeighborChanged, onRandomTick, onTick, onEntityFallOn | Falls when it is sand, gravel or a suspicious block, keeps farmland moisture from nearby water, turns farmland back to dirt when something lands on it, spreads grass onto dirt, and turns grass or mycelium to dirt under a dark cover that blocks light. |
concrete_powder | 16 | onPlace, onBreak, onNeighborChanged, onTick | Falls when nothing holds it up, and turns into concrete of its color when water touches any side but below, or when it falls into water. |
glass | 35 | onBreak | Drops itself to a silk touch tool and shatters into nothing otherwise. |
candle | 34 | onPlace, onBreak, onNeighborChanged, onPlayerInteract | Stacks up to four candles in one block, lights to flint and steel, snuffs to a bare hand, and goes out when water reaches it. |
wall | 32 | onPlace, onBreak, onNeighborChanged | Recomputes the four wall_connection_type states and wall_post_bit from its neighbors and what sits on it. |
redstone | 32 | onPlace, onBreak, onNeighborChanged, onTick, onPlayerInteract, onRedstoneUpdate, onBlockStateChange | Branches by name over the 31 redstone blocks: initializes wire and diode state, handles piston placement and movement, schedules repeater and comparator delays, pulses the observer, updates lit and unlit pairs and triggered containers, and primes TNT with flint and steel. |
container | 22 | onPlace, onBreak, onPlayerInteract | Gives a container its block entity, pairs a chest with the chest beside it, spills its contents on break unless it is a shulker box, and marks a barrel open while a player uses it. |
door | 22 | onPlace, onBreak, onNeighborChanged, onRandomTick, onPlayerInteract, onRedstoneUpdate | Places the upper half, picks the hinge from its neighbors, toggles both halves on interact unless it is iron or the player sneaks with an item, lets sneaking wax or scrape copper doors, follows redstone, and breaks with its other half. |
trapdoor | 22 | onBreak, onRandomTick, onPlayerInteract, onRedstoneUpdate | Toggles open_bit on interact unless it is iron or the player sneaks with an item, lets sneaking wax or scrape copper trapdoors, follows redstone, and oxidizes when it is copper. |
ore | 20 | onBreak | Drops the ore item and its experience; an unlisted ore drops itself. |
pressure_plate | 17 | onPlace, onNeighborChanged, onTick, onStepOn | Checks support on placement and puts out redstone_signal while something stands on it, with the weighted plates counting entities, and releases on a scheduled tick. |
button | 15 | onPlace, onNeighborChanged, onTick, onPlayerInteract | Checks support on placement, presses on interact, powers for 30 ticks on wood and 20 on stone, then releases on the scheduled tick. |
fence | 15 | onPlace, onBreak, onNeighborChanged, onRandomTick, onPlayerInteract | Recomputes the four minecraft:connection states, and waxes, scrapes and oxidizes when it is copper. Iron bars follow the pane rule, which refuses fences. |
crop | 15 | onBreak, onNeighborChanged, onRandomTick, onPlayerInteract | Advances growth on a random tick at a chance the farmland moisture sets, pops off anything but farmland, and harvests the berry blocks on interact. |
leaves | 14 | onBreak, onRandomTick | Decays on a random tick when no log is within six blocks through other leaves, unless persistent_bit is set, drops a sapling by chance, and drops itself to shears or silk touch. |
fence_gate | 13 | onPlace, onBreak, onNeighborChanged, onPlayerInteract, onRedstoneUpdate | Toggles open_bit on interact and on redstone, and sets in_wall_bit when a wall sits on either side. |
climbing | 11 | onPlace, onBreak, onNeighborChanged, onTick | Pops without the face it hangs on, gives scaffolding its stability distance from the supported block, and holds a vine or a lichen back from anything but shears. |
sapling | 11 | onBreak, onNeighborChanged, onRandomTick | Advances age_bit on a random tick and grows a tree on the next one. The tree shape is provisional until the feature runtime owns it. |
furnace | 9 | onPlace, onBreak, onNeighborChanged, onPlayerInteract, onStepOn | Gives the block its slots, faces the placer, drops its contents on break, extinguishes a campfire that water reaches, and relights one with flint and steel. |
dripstone | 8 | onBreak, onNeighborChanged, onRandomTick | Grows an amethyst bud on a free face of a budding block, advances a bud a stage, and drops shards from a cluster. |
head | 7 | onPlace, onBreak, onNeighborChanged | Keeps its rotation and profile in a block entity and pops when the block it sits on goes. |
portal | 6 | onPlace, onNeighborChanged, onRandomTick, onTick, onPlayerInteract, onStepOn | Lights a nether portal when fire appears inside a frame, collapses it when a frame block goes, fills a complete end portal ring, rolls the zombified piglin spawn, counts an entity down to a trip, and ages fire out. The end gateway is claimed here for a later teleport and has no hook yet. Travel is the server's. |
chemistry | 5 | none | No hooks. The chemistry workbenches open Education Edition screens a vanilla server does not implement. |
ice | 4 | onBreak, onRandomTick | Melts to water on a random tick above light 12, frosted ice ages through its four stages first, and a silk touch tool takes the block itself instead of leaving water. |
liquid | 4 | onPlace, onNeighborChanged, onRandomTick, onTick, onPlayerInteract, onStepOn | Spreads on a scheduled tick at the rate its dimension sets, turns to rock where water meets lava, burns what stands in lava, and gives a source block up to a bucket or a bottle. |
rail | 4 | onPlace, onBreak, onNeighborChanged, onRedstoneUpdate | Pops without a block below, and sets rail_data_bit on the powered rails from the signal reaching them. |
sculk | 4 | onBreak, onTick, onStepOn | Runs the shrieker warning, cycles the sensor through its three phases, and gives experience for breaking sculk. The catalyst needs a mob death, which no block hook reports. |
torch | 2 | onBreak, onNeighborChanged | Reads torch_facing_direction to find the face it stands on and pops when that face stops holding it. |
dripleaf | 3 | onNeighborChanged, onTick, onStepOn | Tilts a big dripleaf a stage per scheduled tick while an entity stands on it, then drops it and resets. |
egg | 3 | onRandomTick, onEntityFallOn | Cracks through cracked_state on a random tick and hatches the entity when it is fully cracked. |
lantern | 3 | onBreak, onNeighborChanged, onRandomTick, onPlayerInteract | Checks the block above when it hangs and the one below when it stands, and waxes, scrapes and oxidizes when it is copper. |
snow | 3 | onBreak, onNeighborChanged, onRandomTick | Melts on a random tick above light 12, drops one snowball per layer, and pops without support. |
banner | 2 | onPlace, onBreak, onNeighborChanged | Keeps the base color and patterns in a block entity and pops when its support goes. |
bed | 2 | onPlace, onBreak, onNeighborChanged, onPlayerInteract | Places the head half, marks occupied_bit while a player sleeps, breaks with its other half, and explodes in the nether and the end. |
cake | 1 | onNeighborChanged, onPlayerInteract | Takes a bite per use through bite_counter and disappears after the seventh. |
cauldron | 1 | onBreak, onPlayerInteract | Takes a whole bucket or two levels from a bottle, gives back the emptied or filled container, and refuses a bottle against lava or powder snow. |
composter | 1 | onPlayerInteract | Adds a layer per use and gives back bone meal at the eighth, which is the level Java calls full. |
flower_pot | 1 | onBreak, onPlayerInteract | Swaps the plant it holds on use and drops it on break; which plants fit is the item runtime decision. |
pane | 0 | onPlace, onNeighborChanged | The pane connection rule, which joins panes, bars, walls and solid blocks but not fences. |
pane is the one family with no vanilla block. The identifier rules send every _pane to glass and iron_bars to fence before the pane rule is reached, so the rule matches nothing. It stays registered because the rule exists in @jsprismarine/blocks and a pack can name it, and because the pane connection rule is what a custom thin block wants.
What is deliberately partial
The remaining limits need a world event or data this package does not own, or behavior from another runtime.
- Family drops are fallbacks. An active
minecraft:lootcomponent selects a behavior-pack table, and mapped blocks without one use Java's table. Family-supplied drops remain for blocks without either table and for hosts with no content runtime; ore experience remains a separate block effect because loot tables do not carry it.
The rest are scoped to this phase:
- Tree growth. A sapling grows a trunk with a two-layer canopy, not the species feature. The real trees belong to the feature runtime; this is enough for the sapling's own rule to be observable, and it is the one provisional piece of the package.
- The sculk catalyst. Its charge comes from a mob death within eight blocks, and no block hook reports a death. The shrieker and the sensor are implemented.
- Portal travel. The geometry is here (below), but which world is "the Nether", the 8:1 coordinate link, the destination search and the client's dimension change belong to the server, which owns the dimension list.
@jsprismarine/prismarine'sDimensionTravelis that half; docs/data-driven/dimensions.md describes the whole trip. The end gateway is claimed by theportalfamily and has no hook, so it teleports nobody. - Redstone wire topology. A wire fades one step per block from its neighbors. Stepping up and down over blocks, and the strong and weak distinction a solid block makes, need the solidity column the overlay is still missing.
- Workstation screens. The crafting table, the loom, the smithing table, the enchanting table and the anvil open a screen. The block side is here; the screens are the item runtime's.
- Bed and bamboo pairing. A bed finds its other half from the facing it was placed with, which no state carries afterwards, so a neighbor change falls back to the support check.
- Education chemistry. Five blocks with no hooks, on purpose. A vanilla server does not run Education Edition screens.
Classes
Interfaces
BlockDestroyOptions
Defined in: block-behaviors/src/world.ts:135
Options for removing a block without asking the family to guess its drops.
Properties
drops?
readonlyoptionaldrops?:boolean
Defined in: block-behaviors/src/world.ts:137
Whether to roll the block's own loot, defaulting to true.
BlockEntityData
Defined in: block-behaviors/src/world.ts:72
What a block entity stores.
Bedrock block entities have no shared schema, so the fields the behaviors agree on are named here and anything else travels under the index signature. A container's items is sparse on purpose: an empty slot is undefined, which is what the comparator fill-level formula counts.
Indexable
[
field:string]:unknown
Properties
capacity?
readonlyoptionalcapacity?:number
Defined in: block-behaviors/src/world.ts:76
How many slots the container has, which the comparator divides by.
items?
readonlyoptionalitems?: readonly (ItemDrop|undefined)[]
Defined in: block-behaviors/src/world.ts:74
One entry per slot, undefined for an empty one.
pistonArm?
readonlyoptionalpistonArm?:object
Defined in: block-behaviors/src/world.ts:82
Bedrock's piston-arm state, stored as native PistonArm block-entity tags.
lastProgress
readonlylastProgress:number
Previous extension progress, 0 when retracted and 1 when extended.
newState
readonlynewState:number
Bedrock piston state the arm is moving toward.
progress
readonlyprogress:number
Current extension progress, 0 when retracted and 1 when extended.
state
readonlystate:number
Bedrock piston state used to draw the arm.
sticky
readonlysticky:boolean
Whether the piston is sticky.
sealed?
readonlyoptionalsealed?:boolean
Defined in: block-behaviors/src/world.ts:80
True once wax or a similar seal makes the block entity read-only.
text?
readonlyoptionaltext?: readonlystring[]
Defined in: block-behaviors/src/world.ts:78
A sign's lines, a lectern's book title, a jukebox's record.
BlockFamily
Defined in: block-behaviors/src/family.ts:69
One behavior family: a name in this project's namespace and its handlers.
Properties
handlers
readonlyhandlers:FamilyHandlers
Defined in: block-behaviors/src/family.ts:72
name
readonlyname:string
Defined in: block-behaviors/src/family.ts:71
The name behaviorFor produces for the block identifiers this family covers.
summary
readonlysummary:string
Defined in: block-behaviors/src/family.ts:74
What the family does and what it leaves out, for the README table and for readers.
BlockFlammability
Defined in: block-behaviors/src/world.ts:115
The chance modifiers a resolved minecraft:flammable component carries.
Properties
burnOdds
readonlyburnOdds:number
Defined in: block-behaviors/src/world.ts:119
Fire's odds of consuming the block after it catches.
igniteOdds
readonlyigniteOdds:number
Defined in: block-behaviors/src/world.ts:117
Fire's odds of catching the block alight.
BlockWorld
Defined in: block-behaviors/src/world.ts:290
The dimensions a behavior can reach.
A behavior resolves the event block's dimension once per event, so a portal can look at the other side without every other family paying for a dimension argument.
Methods
at()
at(
dimension):WorldActions
Defined in: block-behaviors/src/world.ts:292
The actions for one dimension, such as minecraft:overworld.
Parameters
dimension
string
Returns
CopperName
Defined in: block-behaviors/src/rules/weathering.ts:18
A copper block's name read into its three parts.
Properties
shape
readonlyshape:string
Defined in: block-behaviors/src/rules/weathering.ts:23
The shape, such as cut_copper_stairs, with copper for the plain block.
stage
readonlystage:WeatheringStage
Defined in: block-behaviors/src/rules/weathering.ts:21
waxed
readonlywaxed:boolean
Defined in: block-behaviors/src/rules/weathering.ts:20
True when honeycomb sealed the block and it no longer oxidizes.
FamilyContext
Defined in: block-behaviors/src/family.ts:34
What a family handler knows about the block type it was built for.
Properties
definition
readonlydefinition:Definition
Defined in: block-behaviors/src/family.ts:38
The definition the type resolved from, which the component readers go through.
identifier
readonlyidentifier:string
Defined in: block-behaviors/src/family.ts:36
The namespaced identifier of the block type, such as minecraft:oak_door.
properties
readonlyproperties:BlockProperties
Defined in: block-behaviors/src/family.ts:40
The block's jsprismarine:block_properties, defaults filled in.
world
readonlyworld:BlockWorld
Defined in: block-behaviors/src/family.ts:42
Every dimension, for the families that reach across one.
FamilyHandlers
Defined in: block-behaviors/src/family.ts:46
The handlers one family implements, keyed by hook name.
Properties
onBlockStateChange?
readonlyoptionalonBlockStateChange?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:65
Parameters
event
world
context
Returns
void
onBreak?
readonlyoptionalonBreak?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:48
Parameters
event
world
context
Returns
void
onEntity?
readonlyoptionalonEntity?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:63
Parameters
event
world
context
Returns
void
onEntityFallOn?
readonlyoptionalonEntityFallOn?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:62
Parameters
event
world
context
Returns
void
onNeighborChanged?
readonlyoptionalonNeighborChanged?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:49
Parameters
event
world
context
Returns
void
onPlace?
readonlyoptionalonPlace?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:47
Parameters
event
world
context
Returns
void
onPlayerInteract?
readonlyoptionalonPlayerInteract?: (event,world,context) =>boolean|BlockInteractResult|undefined
Defined in: block-behaviors/src/family.ts:56
Parameters
event
world
context
Returns
boolean | BlockInteractResult | undefined
onRandomTick?
readonlyoptionalonRandomTick?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:54
Parameters
event
world
context
Returns
void
onRedstoneUpdate?
readonlyoptionalonRedstoneUpdate?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:64
Parameters
event
world
context
Returns
void
onStepOn?
readonlyoptionalonStepOn?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:61
Parameters
event
world
context
Returns
void
onTick?
readonlyoptionalonTick?: (event,world,context) =>void
Defined in: block-behaviors/src/family.ts:55
Parameters
event
world
context
Returns
void
FireTickOptions
Defined in: block-behaviors/src/rules/fire.ts:159
One fire tick's environment-specific switches.
Properties
increasedBurnout?
readonlyoptionalincreasedBurnout?:boolean
Defined in: block-behaviors/src/rules/fire.ts:161
Java's humid-biome attribute halves spread odds and narrows burnout denominators.
spreads?
readonlyoptionalspreads?:boolean
Defined in: block-behaviors/src/rules/fire.ts:163
Whether the fire rule permits this position to spread around players.
HarnessOptions
Defined in: block-behaviors/src/harness.ts:32
How a harness builds the definition and picks the world and dimension.
Properties
components?
readonlyoptionalcomponents?:Readonly<Record<string,unknown>>
Defined in: block-behaviors/src/harness.ts:38
The block definition's components, such as jsprismarine:block_properties.
dimension?
readonlyoptionaldimension?:string
Defined in: block-behaviors/src/harness.ts:36
The dimension events report, defaulting to the overworld.
world?
readonlyoptionalworld?:VoxelWorld
Defined in: block-behaviors/src/harness.ts:34
The world to bind against; a fresh empty one when absent.
ItemDrop
Defined in: block-behaviors/src/world.ts:36
An item stack leaving a block, as a drop, an ejection or a container's contents.
Everything past the identifier and the count is per-stack state rather than a fact about the item type, and every field is optional because most stacks carry none of it. They are here because this is also the shape a container's slots are in: an identifier and a count alone meant a player who put an enchanted pickaxe in a chest got a plain one back.
Properties
contents?
readonlyoptionalcontents?: readonly (ItemDrop|undefined)[]
Defined in: block-behaviors/src/world.ts:61
What a container item holds, one entry per slot and undefined for an empty one.
Java's minecraft:container, which is what a shulker box carries its inventory in between being broken and being placed again.
count
readonlycount:number
Defined in: block-behaviors/src/world.ts:39
customName?
readonlyoptionalcustomName?:string
Defined in: block-behaviors/src/world.ts:51
The name an anvil gave the stack, which replaces the item's own.
damage?
readonlyoptionaldamage?:number
Defined in: block-behaviors/src/world.ts:49
Durability spent, which is Java's minecraft:damage and Bedrock's tag.Damage.
Spent rather than remaining, so a stack of an item whose maximum durability changed between versions comes back damaged by the same amount rather than by a different fraction of a different total.
enchantments?
readonlyoptionalenchantments?:Readonly<Record<string,number>>
Defined in: block-behaviors/src/world.ts:54
Namespaced Java enchantment id to level, which is minecraft:enchantments.
identifier
readonlyidentifier:string
Defined in: block-behaviors/src/world.ts:38
The namespaced item identifier, such as minecraft:wheat_seeds.
lore?
readonlyoptionallore?: readonlystring[]
Defined in: block-behaviors/src/world.ts:52
meta?
readonlyoptionalmeta?:number
Defined in: block-behaviors/src/world.ts:41
The aux value, which is Bedrock's top-level Damage and a potion's variant.
LiquidState
Defined in: block-behaviors/src/rules/fluid.ts:76
A liquid's source and flow state as represented by Bedrock block states.
Properties
amount
readonlyamount:number
Defined in: block-behaviors/src/rules/fluid.ts:80
The amount carried by the flowing state, from 1 through 8.
falling
readonlyfalling:boolean
Defined in: block-behaviors/src/rules/fluid.ts:82
Whether the liquid is falling from above.
kind
readonlykind:"water"|"lava"
Defined in: block-behaviors/src/rules/fluid.ts:78
Whether the block contains water or lava.
source
readonlysource:boolean
Defined in: block-behaviors/src/rules/fluid.ts:84
Whether this is a source block.
OreDrop
Defined in: block-behaviors/src/families/simple.ts:20
What an ore drops when it is mined, and how much experience comes with it.
Java puts these in loot tables, which arrive with the loot package. Until then the twenty palette ores are listed with the item each one yields, so breaking an ore produces the right item instead of nothing.
Properties
count
readonlycount:number
Defined in: block-behaviors/src/families/simple.ts:22
experience
readonlyexperience:number
Defined in: block-behaviors/src/families/simple.ts:24
Experience orbs the break releases, which loot tables do not carry.
identifier
readonlyidentifier:string
Defined in: block-behaviors/src/families/simple.ts:21
PlaceOptions
Defined in: block-behaviors/src/harness.ts:78
What a test says about a placement beyond the block that is now there.
Properties
face?
readonlyoptionalface?:"down"|"up"|"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/harness.ts:86
The face of the block the new one went against, which picks a pillar's axis.
faceLocation?
readonlyoptionalfaceLocation?:FaceLocation
Defined in: block-behaviors/src/harness.ts:91
Where on that face the click landed, each component in [0, 1]. Absent with a face given means the middle of the face.
itemStack?
readonlyoptionalitemStack?:HookItem
Defined in: block-behaviors/src/harness.ts:84
The item the placement came out of.
placedBy?
readonlyoptionalplacedBy?:HookActor
Defined in: block-behaviors/src/harness.ts:80
Who placed it. Absent means TEST_PLAYER; undefined means the world did.
previous?
readonlyoptionalprevious?:object
Defined in: block-behaviors/src/harness.ts:82
What the placement overwrote, which the merging families read.
identifier
readonlyidentifier:string
states?
readonlyoptionalstates?:Readonly<Record<string,BlockStateValue>>
PortalCreationBounds
Defined in: block-behaviors/src/rules/portal.ts:392
The vertical range portal creation may use in one dimension.
Properties
maxY
readonlymaxY:number
Defined in: block-behaviors/src/rules/portal.ts:396
The first y above the build limit, 128 in the Nether and 320 in the Overworld.
minY
readonlyminY:number
Defined in: block-behaviors/src/rules/portal.ts:394
The lowest y a block can occupy.
PortalCreationSite
Defined in: block-behaviors/src/rules/portal.ts:400
Where a new portal goes, as portalCreationSite decided it.
Properties
at
readonlyat:BlockPosition
Defined in: block-behaviors/src/rules/portal.ts:402
The bottom-left interior block of the portal to write.
forced
readonlyforced:boolean
Defined in: block-behaviors/src/rules/portal.ts:404
True when no footing was found and the portal floats on its own platform.
PortalFrame
Defined in: block-behaviors/src/rules/portal.ts:69
A nether portal's interior rectangle.
bottomLeft is the interior block with the lowest y and the lowest coordinate along the axis, so the interior extends toward positive axis by width and upward by height. The frame sits one block outside that rectangle on all four sides.
Properties
axis
readonlyaxis:PortalAxis
Defined in: block-behaviors/src/rules/portal.ts:71
bottomLeft
readonlybottomLeft:BlockPosition
Defined in: block-behaviors/src/rules/portal.ts:70
height
readonlyheight:number
Defined in: block-behaviors/src/rules/portal.ts:75
Interior blocks upward, 3 to 21.
width
readonlywidth:number
Defined in: block-behaviors/src/rules/portal.ts:73
Interior blocks along the axis, 2 to 21.
PushPlan
Defined in: block-behaviors/src/rules/piston.ts:22
What a push would do, worked out before anything moves.
Properties
blocked
readonlyblocked:boolean
Defined in: block-behaviors/src/rules/piston.ts:30
True when nothing moves: an immovable block or more than the limit.
destroyed
readonlydestroyed:BlockPosition|undefined
Defined in: block-behaviors/src/rules/piston.ts:26
The first position broken instead of moved, kept for callers that need one result.
destroyedBlocks
readonlydestroyedBlocks: readonlyBlockPosition[]
Defined in: block-behaviors/src/rules/piston.ts:28
Every position broken instead of moved, including sticky branches.
moved
readonlymoved: readonlyBlockPosition[]
Defined in: block-behaviors/src/rules/piston.ts:24
The positions that move, nearest the piston first.
RecordedDrop
Defined in: block-behaviors/src/voxelWorld.ts:30
One item stack a behavior dropped.
Properties
drop
readonlydrop:ItemDrop
Defined in: block-behaviors/src/voxelWorld.ts:32
position
readonlyposition:BlockPosition
Defined in: block-behaviors/src/voxelWorld.ts:31
RecordedEffect
Defined in: block-behaviors/src/voxelWorld.ts:36
One sound or particle a behavior emitted.
Properties
name
readonlyname:string
Defined in: block-behaviors/src/voxelWorld.ts:39
The sound event or particle name.
position
readonlyposition:BlockPosition
Defined in: block-behaviors/src/voxelWorld.ts:37
RecordedEntity
Defined in: block-behaviors/src/voxelWorld.ts:50
One entity a behavior spawned, still listed after it is removed.
Properties
data
readonlydata:BlockEntityData|undefined
Defined in: block-behaviors/src/voxelWorld.ts:54
id
readonlyid:number
Defined in: block-behaviors/src/voxelWorld.ts:51
identifier
readonlyidentifier:string
Defined in: block-behaviors/src/voxelWorld.ts:52
position
readonlyposition:BlockPosition
Defined in: block-behaviors/src/voxelWorld.ts:53
removed
removed:
boolean
Defined in: block-behaviors/src/voxelWorld.ts:56
True once WorldActions.removeEntity took it out of the world.
RecordedTick
Defined in: block-behaviors/src/voxelWorld.ts:43
One tick a behavior asked for.
Properties
delay
readonlydelay:number
Defined in: block-behaviors/src/voxelWorld.ts:46
Game ticks from the request to the tick.
position
readonlyposition:BlockPosition
Defined in: block-behaviors/src/voxelWorld.ts:44
SpreadResult
Defined in: block-behaviors/src/rules/fluid.ts:418
The sides and direction a flow step took.
Properties
down
readonlydown:boolean
Defined in: block-behaviors/src/rules/fluid.ts:420
Whether this step flowed downward.
sides
readonlysides: readonly ("north"|"south"|"west"|"east")[]
Defined in: block-behaviors/src/rules/fluid.ts:422
The horizontal faces this step flowed along.
WorldActions
Defined in: block-behaviors/src/world.ts:157
Everything a block does to the world, for one dimension.
Every position is in world coordinates and in this instance's dimension. A behavior never crosses dimensions through one instance; it asks BlockWorld.at for the other one.
Methods
canFireSpreadAround()?
optionalcanFireSpreadAround(position):boolean
Defined in: block-behaviors/src/world.ts:255
Whether fire may spread around this position under the current world rule.
Parameters
position
Returns
boolean
destroyBlock()?
optionaldestroyBlock(position,options?):boolean
Defined in: block-behaviors/src/world.ts:217
Takes a block out of the world the way the world itself does: its own onBreak runs and Java's loot table decides what falls.
A family calls this rather than dropping one of the block, because one of the block is a guess. Deepslate yields cobbled deepslate, a lapis block yields lapis, and a block the table gives nothing for yields nothing.
The write is still the caller's, and it has to come afterwards: a family reads the block entity it is about to lose, which is what spills a chest a piston popped.
Left out by a world with no loot behind it, such as the test voxel world, which sends the caller back to the drop it would have made on its own.
Parameters
position
The block to destroy.
options?
Whether the block's own loot is rolled. Defaults to true.
Returns
boolean
True when the world took the drops, so the caller owes nothing more for them.
difficulty()?
optionaldifficulty():"normal"|"peaceful"|"easy"|"hard"
Defined in: block-behaviors/src/world.ts:249
The current world difficulty, which controls fire spread odds.
Returns
"normal" | "peaceful" | "easy" | "hard"
dropItem()
dropItem(
position,drop):void
Defined in: block-behaviors/src/world.ts:198
Drops an item stack as an entity at a position.
Parameters
position
drop
Returns
void
entitiesAt()
entitiesAt(
position): readonlyWorldEntity[]
Defined in: block-behaviors/src/world.ts:229
Every entity whose position is inside the block at a position.
Parameters
position
Returns
readonly WorldEntity[]
flammabilityOf()?
optionalflammabilityOf(block):BlockFlammability|undefined
Defined in: block-behaviors/src/world.ts:182
The resolved block state's minecraft:flammable odds, when content exposes them.
Parameters
block
Returns
BlockFlammability | undefined
fluidSourceConversion()?
optionalfluidSourceConversion(kind):boolean
Defined in: block-behaviors/src/world.ts:196
Whether infinite sources form for a fluid kind; defaults to vanilla game-rule values.
Parameters
kind
"water" | "lava"
Returns
boolean
getBlock()
getBlock(
position):HookBlock|undefined
Defined in: block-behaviors/src/world.ts:159
The block at a position, or undefined when the position is not loaded.
Parameters
position
Returns
HookBlock | undefined
getBlockData()
getBlockData(
position):BlockEntityData|undefined
Defined in: block-behaviors/src/world.ts:259
A block entity's data, or undefined when the position has none.
Parameters
position
Returns
BlockEntityData | undefined
hasBlockTag()?
optionalhasBlockTag(block,tag):boolean|undefined
Defined in: block-behaviors/src/world.ts:190
Whether the block belongs to a Java block tag such as minecraft:infiniburn_overworld.
Parameters
block
tag
string
Returns
boolean | undefined
Undefined when the loaded stack declares no such tag, which is not the same answer as false: a rule whose tag nobody loaded has to fall back to its own names rather than read every block as being outside it.
hasSturdyTopFace()?
optionalhasSturdyTopFace(block):boolean
Defined in: block-behaviors/src/world.ts:192
Whether this block has a sturdy top face, when the host can report its collision shape.
Parameters
block
Returns
boolean
increasedFireBurnout()?
optionalincreasedFireBurnout(position):boolean
Defined in: block-behaviors/src/world.ts:257
Whether this position has the humid biome attribute that increases fire burnout.
Parameters
position
Returns
boolean
isFullCube()?
optionalisFullCube(block):boolean
Defined in: block-behaviors/src/world.ts:194
Whether this block fills its cell with a full cube collision shape.
Parameters
block
Returns
boolean
isRainingAt()?
optionalisRainingAt(position):boolean
Defined in: block-behaviors/src/world.ts:253
Whether rain reaches this position.
Parameters
position
Returns
boolean
lightDampeningOf()?
optionallightDampeningOf(block):number
Defined in: block-behaviors/src/world.ts:180
The block state's vanilla minecraft:light_dampening value, when the host can report it.
Parameters
block
Returns
number
lightLevel()
lightLevel(
position):number
Defined in: block-behaviors/src/world.ts:273
The light level at a position, 0 to 15, as the growth and melt rules read it.
Parameters
position
Returns
number
moveBlock()?
optionalmoveBlock(from,to):void
Defined in: block-behaviors/src/world.ts:176
Moves a block and its block entity without running placement hooks.
Parameters
from
to
Returns
void
notifyNeighbors()
notifyNeighbors(
position):void
Defined in: block-behaviors/src/world.ts:263
Tells the six neighbors of a position that it changed.
Parameters
position
Returns
void
playSound()
playSound(
position,sound):void
Defined in: block-behaviors/src/world.ts:231
Plays a sound event, such as block.door.open.
Parameters
position
sound
string
Returns
void
propertiesOf()
propertiesOf(
identifier):BlockProperties
Defined in: block-behaviors/src/world.ts:178
The jsprismarine:block_properties of a block type, defaults included.
Parameters
identifier
string
Returns
random()
random():
number
Defined in: block-behaviors/src/world.ts:280
A number in [0, 1).
Chance lives on the interface rather than in the families so a test can drive a probabilistic rule to either outcome without patching globals.
Returns
number
randomFloat()?
optionalrandomFloat():number
Defined in: block-behaviors/src/world.ts:247
A random float in [0, 1), using the host's world random when available.
Returns
number
randomInt()?
optionalrandomInt(bound):number
Defined in: block-behaviors/src/world.ts:245
A random integer in [0, bound), using the host's world random when available.
Parameters
bound
number
Returns
number
redstoneConductor()?
optionalredstoneConductor(position):boolean
Defined in: block-behaviors/src/world.ts:271
Whether a block carries redstone power through its direct signal.
Parameters
position
Returns
boolean
redstoneDirectSignal()?
optionalredstoneDirectSignal(position,directionToSource):number
Defined in: block-behaviors/src/world.ts:269
The strong signal from a block, where direction points from the receiver to this source.
Parameters
position
directionToSource
"down" | "up" | "north" | "south" | "west" | "east"
Returns
number
redstonePower()
redstonePower(
position):number
Defined in: block-behaviors/src/world.ts:265
The redstone power reaching a position, 0 to 15.
Parameters
position
Returns
number
redstoneSignal()?
optionalredstoneSignal(position,directionToSource):number
Defined in: block-behaviors/src/world.ts:267
The signal from a block, where direction points from the receiver to this source.
Parameters
position
directionToSource
"down" | "up" | "north" | "south" | "west" | "east"
Returns
number
removeEntity()
removeEntity(
entity):void
Defined in: block-behaviors/src/world.ts:227
Removes an entity by the id WorldActions.spawnEntity returned.
Parameters
entity
number
Returns
void
scheduleTick()
scheduleTick(
position,delay,kind?,priority?):void
Defined in: block-behaviors/src/world.ts:241
Asks for onTick at a position after a delay.
Parameters
position
delay
number
Game ticks from now, at least 1.
kind?
"block" | "fluid"
Whether the tick belongs to the block or fluid list; defaults to block.
priority?
The scheduled tick's ordering priority; defaults to normal.
Returns
void
setBlock()
setBlock(
position,identifier,states?,notifyNeighbors?,placement?):void
Defined in: block-behaviors/src/world.ts:168
Replaces the block at a position.
Parameters
position
identifier
string
states?
Readonly<Record<string, BlockStateValue>>
The whole state record, not a patch. Absent means the block's default state.
notifyNeighbors?
boolean
Whether to run block behavior and engine neighbor updates.
placement?
Player and hit details for a placement that raises onPlace.
Returns
void
setBlockData()
setBlockData(
position,data):void
Defined in: block-behaviors/src/world.ts:261
Replaces a block entity's data whole.
Parameters
position
data
Returns
void
spawnEntity()
spawnEntity(
position,identifier,data?):number
Defined in: block-behaviors/src/world.ts:225
Spawns an entity.
Parameters
position
identifier
string
data?
The entity's own data, such as the block a falling block entity carries.
Returns
number
The id WorldActions.removeEntity takes.
spawnParticle()
spawnParticle(
position,particle):void
Defined in: block-behaviors/src/world.ts:233
Emits a particle effect, such as minecraft:crop_growth_emitter.
Parameters
position
particle
string
Returns
void
weather()?
optionalweather():WorldWeather
Defined in: block-behaviors/src/world.ts:251
The current weather.
Returns
willTickThisTick()?
optionalwillTickThisTick(position):boolean
Defined in: block-behaviors/src/world.ts:243
Whether this block's scheduled tick is due in the batch currently running.
Parameters
position
Returns
boolean
WorldEntity
Defined in: block-behaviors/src/world.ts:103
An entity a behavior found in the world.
HookActor is what a hook event carries and has no identity, so this adds the id WorldActions.removeEntity takes.
Extends
Properties
id
readonlyid:number
Defined in: block-behaviors/src/world.ts:104
identifier
readonlyidentifier:string
Defined in: blocks/src/hooks.ts:61
The namespaced entity identifier, such as minecraft:player.
Inherited from
pitch?
readonlyoptionalpitch?:number
Defined in: blocks/src/hooks.ts:64
The actor's pitch when the host knows it.
Inherited from
position
readonlyposition:BlockPosition
Defined in: blocks/src/hooks.ts:62
Inherited from
yaw?
readonlyoptionalyaw?:number
Defined in: blocks/src/hooks.ts:66
The actor's yaw when the host knows it.
Inherited from
Type Aliases
BlockHalf
BlockHalf =
"bottom"|"top"
Defined in: block-behaviors/src/rules/placement.ts:17
Which half of a block a placement lands in.
BlockProperties
BlockProperties =
Parameters<typeofcreate>[0]
Defined in: block-behaviors/src/world.ts:112
The per-state facts the overlay's jsprismarine:block_properties component carries, derived from the component factory that declares them so the field names and the push_reaction domain have one source.
BlockStates
BlockStates =
Readonly<Record<string,BlockStateValue>>
Defined in: block-behaviors/src/world.ts:23
The state values a behavior writes when it places or rewrites a block.
BlockTickPriority
BlockTickPriority =
"extremely_high"|"very_high"|"high"|"normal"
Defined in: block-behaviors/src/world.ts:26
Java tick priorities used when one block's scheduled change must precede another's.
ConnectionKind
ConnectionKind =
"fence"|"pane"|"wall"
Defined in: block-behaviors/src/rules/connection.ts:20
Which connection rule a block follows.
FallStep
FallStep =
"fell"|"landed"
Defined in: block-behaviors/src/rules/gravity.ts:60
What one tick of a fall did.
HorizontalFace
HorizontalFace = typeof
HORIZONTAL_FACES[number]
Defined in: block-behaviors/src/geometry.ts:26
One of HORIZONTAL_FACES.
PortalAxis
PortalAxis =
"x"|"z"
Defined in: block-behaviors/src/rules/portal.ts:56
The horizontal axis a nether portal's plane runs along.
PushReaction
PushReaction =
BlockProperties["pushReaction"]
Defined in: block-behaviors/src/world.ts:141
One of the four values jsprismarine:block_properties.push_reaction takes.
StairCorner
StairCorner = typeof
STAIR_CORNERS[number]
Defined in: block-behaviors/src/rules/stairShape.ts:20
One of STAIR_CORNERS.
WallConnection
WallConnection =
"none"|"short"|"tall"
Defined in: block-behaviors/src/rules/connection.ts:39
The three heights a wall connection takes.
WeatheringStage
WeatheringStage =
0|1|2|3
Defined in: block-behaviors/src/rules/weathering.ts:15
How far along the four oxidation stages a copper block is.
WorldDifficulty
WorldDifficulty = typeof
WORLD_DIFFICULTIES[number]
Defined in: block-behaviors/src/world.ts:129
One of WORLD_DIFFICULTIES.
WorldWeather
WorldWeather =
"clear"|"rain"|"thunder"
Defined in: block-behaviors/src/world.ts:123
Whether the sky and weather report rain, thunder or clear.
Variables
AIR
constAIR:"minecraft:air"='minecraft:air'
Defined in: block-behaviors/src/identifiers.ts:14
The identifier an empty position holds.
AMETHYST_STAGES
constAMETHYST_STAGES: readonlystring[]
Defined in: block-behaviors/src/families/ground.ts:262
The four amethyst bud stages, in the order a budding block grows them.
BEACON_BASE_NAMES
constBEACON_BASE_NAMES:ReadonlySet<string>
Defined in: block-behaviors/src/families/containers.ts:349
The blocks a beacon pyramid is built from.
BUCKET_CONTENTS
constBUCKET_CONTENTS:Readonly<Record<string,string>>
Defined in: block-behaviors/src/rules/heldItem.ts:78
What each filled bucket pours out, keyed by the bucket's bare name.
BUTTON_PRESS_TICKS
constBUTTON_PRESS_TICKS:Readonly<Record<"wooden"|"stone",number>>
Defined in: block-behaviors/src/rules/redstone.ts:22
How long a button stays pressed, by material, in game ticks.
CAKE_BITES
constCAKE_BITES:6=6
Defined in: block-behaviors/src/families/furniture.ts:20
How many bites a cake takes before it is gone.
CARDINAL_DIRECTIONS
constCARDINAL_DIRECTIONS: readonly ["south","west","north","east"]
Defined in: block-behaviors/src/geometry.ts:116
The minecraft:cardinal_direction domain, in the order the palette declares its values. cardinalDirections.test.ts checks the order against the captured palette, which is the published source for it.
CAULDRON_BOTTLE_LEVELS
constCAULDRON_BOTTLE_LEVELS:2=2
Defined in: block-behaviors/src/families/containers.ts:60
How many fill_level steps one bottle moves, so three bottles fill a cauldron.
CAULDRON_FULL
constCAULDRON_FULL:6=6
Defined in: block-behaviors/src/families/containers.ts:57
The levels a cauldron fills to, which is the top of the fill_level domain.
COBBLESTONE
constCOBBLESTONE:"minecraft:cobblestone"='minecraft:cobblestone'
Defined in: block-behaviors/src/identifiers.ts:32
What lava makes when water reaches flowing lava from the side.
COMPASS_DIRECTIONS
constCOMPASS_DIRECTIONS: readonly ["north","east","south","west"]
Defined in: block-behaviors/src/geometry.ts:138
The compass-order domain a decorated pot's numeric direction uses: north 0, east 1, south 2, west 3. It is a separate table from WEIRDO_DIRECTIONS because that legacy order starts at east.
COMPOSTER_FULL
constCOMPOSTER_FULL:7=7
Defined in: block-behaviors/src/families/containers.ts:54
How many layers a composter takes before it makes bone meal.
CONNECTION_STATES
constCONNECTION_STATES:Readonly<Record<HorizontalFace,string>>
Defined in: block-behaviors/src/rules/connection.ts:23
The trait state a fence, a pane or a set of bars carries per direction.
CONTAINER_SLOTS
constCONTAINER_SLOTS:Readonly<Record<string,number>>
Defined in: block-behaviors/src/rules/container.ts:17
How many slots each kind of container has.
DEFAULT_BLOCK_PROPERTIES
constDEFAULT_BLOCK_PROPERTIES:BlockProperties
Defined in: block-behaviors/src/world.ts:144
The values a block with no jsprismarine:block_properties component reads as.
ENCHANTMENTS_COMPONENT
constENCHANTMENTS_COMPONENT:"minecraft:enchantments"='minecraft:enchantments'
Defined in: block-behaviors/src/rules/heldItem.ts:22
minecraft:enchantments, which holds a level per enchantment id.
END_PORTAL
constEND_PORTAL:string
Defined in: block-behaviors/src/rules/portal.ts:38
The end portal block the frame ring fills with.
END_PORTAL_EYE_STATE
constEND_PORTAL_EYE_STATE:"end_portal_eye_bit"='end_portal_eye_bit'
Defined in: block-behaviors/src/rules/portal.ts:297
The state an end portal frame sets once an eye of ender is in it.
END_PORTAL_FACING_STATE
constEND_PORTAL_FACING_STATE:"minecraft:cardinal_direction"='minecraft:cardinal_direction'
Defined in: block-behaviors/src/rules/portal.ts:300
The state that says which way an end portal frame faces.
END_PORTAL_FRAME_BLOCKS
constEND_PORTAL_FRAME_BLOCKS: readonlystring[]
Defined in: block-behaviors/src/rules/portal.ts:41
The blocks an end portal ring is made of.
END_PORTAL_SPAWN_SOUND
constEND_PORTAL_SPAWN_SOUND:"block.end_portal.spawn"='block.end_portal.spawn'
Defined in: block-behaviors/src/rules/portal.ts:303
The sound Bedrock plays when a ring fills with end portal.
FACE_STEPS
constFACE_STEPS:Readonly<Record<BlockFace,BlockPosition>>
Defined in: block-behaviors/src/geometry.ts:13
The unit step from a block to the neighbor on one face.
FACING_DIRECTIONS
constFACING_DIRECTIONS: readonly ["down","up","north","south","west","east"] =BLOCK_FACES
Defined in: block-behaviors/src/geometry.ts:103
The facing_direction state's domain, which is Bedrock's Facing.json order and the same order BLOCK_FACES is written in.
FALL_DELAY
constFALL_DELAY:2=2
Defined in: block-behaviors/src/rules/gravity.ts:18
Game ticks between a falling block's check and its first move, as Bedrock schedules it.
FARMLAND_NAMES
constFARMLAND_NAMES:ReadonlySet<string>
Defined in: block-behaviors/src/rules/growth.ts:33
The blocks a crop accepts under it, for a host that answers no tags.
Both crop tags hold farmland and nothing else in vanilla; the tags are the source of truth and this is only reached when the stack declares no such tag.
FARMLAND_WATER_RANGE
constFARMLAND_WATER_RANGE:4=4
Defined in: block-behaviors/src/families/ground.ts:20
How far from a crop farmland looks for water before it dries out.
FIRE
constFIRE:"minecraft:fire"='minecraft:fire'
Defined in: block-behaviors/src/rules/fire.ts:17
The fire block.
FIRE_AGE_STATE
constFIRE_AGE_STATE:"age"='age'
Defined in: block-behaviors/src/rules/fire.ts:20
The state fire carries, 0 to 15.
FIRE_MAX_AGE
constFIRE_MAX_AGE:15=15
Defined in: block-behaviors/src/rules/fire.ts:23
Java's maximum fire age.
FIRE_TICK_DELAY_MIN
constFIRE_TICK_DELAY_MIN:30=30
Defined in: block-behaviors/src/rules/fire.ts:26
The first possible tick delay, in game ticks.
FIRE_TICK_DELAY_SPREAD
constFIRE_TICK_DELAY_SPREAD:10=10
Defined in: block-behaviors/src/rules/fire.ts:29
Fire adds a draw from this range to FIRE_TICK_DELAY_MIN.
FLOWING_LAVA
constFLOWING_LAVA:"minecraft:flowing_lava"='minecraft:flowing_lava'
Defined in: block-behaviors/src/identifiers.ts:26
The flowing lava block.
FLOWING_WATER
constFLOWING_WATER:"minecraft:flowing_water"='minecraft:flowing_water'
Defined in: block-behaviors/src/identifiers.ts:20
The flowing water block, which carries the spread depth.
GROWS_CROPS_TAG
constGROWS_CROPS_TAG:"minecraft:grows_crops"='minecraft:grows_crops'
Defined in: block-behaviors/src/rules/growth.ts:25
Java's #minecraft:grows_crops, the ground a crop draws its growth rate from.
HORIZONTAL_FACES
constHORIZONTAL_FACES: readonly ["north","south","west","east"]
Defined in: block-behaviors/src/geometry.ts:23
The four faces a connection, a wall mount or a cardinal state can use.
LAVA
constLAVA:"minecraft:lava"='minecraft:lava'
Defined in: block-behaviors/src/identifiers.ts:23
The lava source block.
LAVA_SPREAD_TICKS
constLAVA_SPREAD_TICKS:30=30
Defined in: block-behaviors/src/rules/fluid.ts:39
Game ticks between lava spread steps outside the nether.
MAINTAINS_FARMLAND_TAG
constMAINTAINS_FARMLAND_TAG:"minecraft:maintains_farmland"='minecraft:maintains_farmland'
Defined in: block-behaviors/src/families/ground.ts:26
Java's #minecraft:maintains_farmland, which decides whether dry farmland stays farmland.
MAX_CANDLES
constMAX_CANDLES:4=4
Defined in: block-behaviors/src/families/furniture.ts:41
How many candles fit in one block.
MAX_CROP_GROWTH
constMAX_CROP_GROWTH:7=7
Defined in: block-behaviors/src/rules/growth.ts:16
The last growth value a crop reaches.
MAX_LEAF_DISTANCE
constMAX_LEAF_DISTANCE:6=6
Defined in: block-behaviors/src/rules/growth.ts:110
How far a leaf block may be from a log, through other leaves, before it decays.
Java's number, read out of LeavesBlock in the pinned 26.3 server jar. DECAY_DISTANCE is 7 there and decaying removes a leaf whose distance state has reached it, so 6 is the last distance that survives. Java carries distance as a block state and propagates it: updateDistance sets it to one more than the smallest of the six neighbors', counting a block in #minecraft:prevents_nearby_leaf_decay as 0 and anything that is not a leaf as 7. That tag resolves to #minecraft:logs, which is every _log, _wood, _stem and _hyphae and their stripped forms. The fixed point of the propagation is the breadth-first distance from the nearest log through leaves, so the search below computes the same answer without a state to store.
It was 4, which is Bedrock's. The trees here are built from Java's worldgen/feature data, and Java's TreeFeature.updateLeaves writes distances out to 6 from the trunk, so 4 condemned the outer rings of every canopy the generator placed.
MAX_LIQUID_DEPTH
constMAX_LIQUID_DEPTH:7=7
Defined in: block-behaviors/src/rules/fluid.ts:30
The largest horizontal liquid_depth the flowing blocks carry.
MAX_POWER
constMAX_POWER:15=15
Defined in: block-behaviors/src/rules/redstone.ts:16
The strongest signal redstone carries.
MAX_STACK_SIZE
constMAX_STACK_SIZE:64=64
Defined in: block-behaviors/src/rules/container.ts:14
How many of one item a slot holds, which the fill-level formula divides by.
MAX_STALK_HEIGHT
constMAX_STALK_HEIGHT:Readonly<Record<string,number>>
Defined in: block-behaviors/src/families/plants.ts:131
How many blocks a stalk of sugar cane, cactus or bamboo grows to.
MELT_LIGHT
constMELT_LIGHT:12=12
Defined in: block-behaviors/src/families/ground.ts:23
The light level at which ice and snow melt.
MIN_CROP_LIGHT
constMIN_CROP_LIGHT:9=9
Defined in: block-behaviors/src/rules/growth.ts:19
The light a crop needs above it to grow at all.
NETHER
constNETHER:"minecraft:nether"='minecraft:nether'
Defined in: block-behaviors/src/rules/fluid.ts:33
The dimension whose lava uses the faster spread rate.
NETHERRACK
constNETHERRACK:"minecraft:netherrack"='minecraft:netherrack'
Defined in: block-behaviors/src/rules/portal.ts:389
The block Bedrock flanks a forced portal's platform with.
NETHER_LAVA_SPREAD_TICKS
constNETHER_LAVA_SPREAD_TICKS:10=10
Defined in: block-behaviors/src/rules/fluid.ts:42
Game ticks between lava spread steps in the nether.
NETHER_PORTAL
constNETHER_PORTAL:string
Defined in: block-behaviors/src/rules/portal.ts:29
The lit nether portal block Bedrock writes, which is the first name in the shared list.
NETHER_PORTAL_BLOCKS
constNETHER_PORTAL_BLOCKS: readonlystring[]
Defined in: block-behaviors/src/rules/portal.ts:32
Every identifier that reads as a lit nether portal block.
NETHER_PORTAL_FRAME_BLOCKS
constNETHER_PORTAL_FRAME_BLOCKS: readonlystring[]
Defined in: block-behaviors/src/rules/portal.ts:35
The blocks a nether portal frame is made of. Crying obsidian is not one of them.
OBSERVER_PULSE_TICKS
constOBSERVER_PULSE_TICKS:2=2
Defined in: block-behaviors/src/rules/redstone.ts:28
How long an observer holds its pulse, in game ticks.
OBSIDIAN
constOBSIDIAN:"minecraft:obsidian"='minecraft:obsidian'
Defined in: block-behaviors/src/identifiers.ts:29
What lava makes when water reaches a source.
ORE_DROPS
constORE_DROPS:Readonly<Record<string,OreDrop>>
Defined in: block-behaviors/src/families/simple.ts:30
The drop of each ore, keyed by the bare name of the ore block.
OVERWORLD
constOVERWORLD:"minecraft:overworld"='minecraft:overworld'
Defined in: block-behaviors/src/voxelWorld.ts:27
The dimension a VoxelWorld uses when a test names none.
OVERWORLD_DIMENSION
constOVERWORLD_DIMENSION:"minecraft:overworld"='minecraft:overworld'
Defined in: block-behaviors/src/rules/portal.ts:563
The dimension whose portals spawn zombified piglins.
PIGLIN_PORTAL_COOLDOWN_TICKS
constPIGLIN_PORTAL_COOLDOWN_TICKS:300=300
Defined in: block-behaviors/src/rules/portal.ts:572
The PortalCooldown a spawned piglin starts with, so it does not walk straight back in.
PIGLIN_SPAWN_ROLL_BOUND
constPIGLIN_SPAWN_ROLL_BOUND:2000=2000
Defined in: block-behaviors/src/rules/portal.ts:569
Java's NetherPortalBlock.randomTick denominator: random.nextInt(2000) < difficulty.getId().
PISTON_PUSH_LIMIT
constPISTON_PUSH_LIMIT:12=12
Defined in: block-behaviors/src/rules/piston.ts:19
How many blocks one piston moves at once.
PORTAL_AXIS_STATE
constPORTAL_AXIS_STATE:"portal_axis"='portal_axis'
Defined in: block-behaviors/src/rules/portal.ts:59
The portal_axis state name on minecraft:portal.
PORTAL_CREATION_RADIUS
constPORTAL_CREATION_RADIUS:16=16
Defined in: block-behaviors/src/rules/portal.ts:380
Java's PortalForcer search radius around the scaled target, in blocks.
PORTAL_DELAY_TICKS
constPORTAL_DELAY_TICKS:80=80
Defined in: block-behaviors/src/families/world.ts:89
How long a player stands in a nether portal before it moves them, in ticks.
PORTAL_FORCED_MIN_Y
constPORTAL_FORCED_MIN_Y:70=70
Defined in: block-behaviors/src/rules/portal.ts:383
The lowest y a forced portal is written at, Java's bipush 70.
PORTAL_FORCED_TOP_MARGIN
constPORTAL_FORCED_TOP_MARGIN:10=10
Defined in: block-behaviors/src/rules/portal.ts:386
How far below the dimension's height limit a forced portal stays.
PORTAL_LIGHTING_FIRES
constPORTAL_LIGHTING_FIRES: readonlystring[]
Defined in: block-behaviors/src/rules/portal.ts:44
The fires that light a nether portal frame.
PORTAL_MAX_HEIGHT
constPORTAL_MAX_HEIGHT:21=21
Defined in: block-behaviors/src/rules/portal.ts:53
Java's PortalShape.MAX_HEIGHT: the tallest interior, in blocks.
PORTAL_MAX_WIDTH
constPORTAL_MAX_WIDTH:21=21
Defined in: block-behaviors/src/rules/portal.ts:49
Java's PortalShape.MAX_WIDTH: the widest interior, in blocks.
PORTAL_MIN_HEIGHT
constPORTAL_MIN_HEIGHT:3=3
Defined in: block-behaviors/src/rules/portal.ts:51
Java's PortalShape.MIN_HEIGHT: the shortest interior, in blocks.
PORTAL_MIN_WIDTH
constPORTAL_MIN_WIDTH:2=2
Defined in: block-behaviors/src/rules/portal.ts:47
Java's PortalShape.MIN_WIDTH: the narrowest interior, in blocks.
POTION_CONTENTS_COMPONENT
constPOTION_CONTENTS_COMPONENT:"minecraft:potion_contents"='minecraft:potion_contents'
Defined in: block-behaviors/src/rules/heldItem.ts:25
minecraft:potion_contents, which names which potion a minecraft:potion is.
PRESSURE_PLATE_RELEASE_TICKS
constPRESSURE_PLATE_RELEASE_TICKS:20=20
Defined in: block-behaviors/src/rules/redstone.ts:25
How long a pressure plate waits before it checks for an empty plate again.
REDSTONE_TICK
constREDSTONE_TICK:2=2
Defined in: block-behaviors/src/rules/redstone.ts:19
Game ticks in one redstone tick, which is what a repeater delay counts.
REPLACEABLE_NAMES
constREPLACEABLE_NAMES:ReadonlySet<string>
Defined in: block-behaviors/src/identifiers.ts:72
The blocks a placement overwrites instead of being refused, and that a falling block passes through.
Java decides this with a material flag that no published table carries, so the list is the vanilla set of one-block plants, the two fires, both liquids and the engine markers.
SAPLING_DROP_CHANCE
constSAPLING_DROP_CHANCE:number
Defined in: block-behaviors/src/families/plants.ts:277
The chance a decaying leaf block drops a sapling.
SCULK_SPREAD_RANGE
constSCULK_SPREAD_RANGE:8=8
Defined in: block-behaviors/src/families/world.ts:176
How far a sculk catalyst spreads its charge.
SHEARED_CLIMBERS
constSHEARED_CLIMBERS:ReadonlySet<string>
Defined in: block-behaviors/src/families/plants.ts:421
The blocks in climbingFamily that come away only to shears or silk touch. The rest of the family, the ladders, chains and scaffolding, drops to a bare hand.
SOIL_NAMES
constSOIL_NAMES:ReadonlySet<string>
Defined in: block-behaviors/src/rules/growth.ts:36
The blocks a sapling, a flower or a tall plant accepts under it.
STAIR_CORNERS
constSTAIR_CORNERS: readonly ["none","inner_left","inner_right","outer_left","outer_right"]
Defined in: block-behaviors/src/rules/stairShape.ts:17
The five values minecraft:corner takes.
STONE
constSTONE:"minecraft:stone"='minecraft:stone'
Defined in: block-behaviors/src/identifiers.ts:35
What lava makes when it flows down into water.
SUPPORTS_CROPS_TAG
constSUPPORTS_CROPS_TAG:"minecraft:supports_crops"='minecraft:supports_crops'
Defined in: block-behaviors/src/rules/growth.ts:22
Java's #minecraft:supports_crops, the ground a crop may stand on.
TEST_PLAYER
constTEST_PLAYER:HookActor
Defined in: block-behaviors/src/harness.ts:42
The player a harness uses when a test names none.
THE_END
constTHE_END:"minecraft:the_end"='minecraft:the_end'
Defined in: block-behaviors/src/rules/portal.ts:26
The dimension no nether portal can be lit in.
TNT_FUSE_TICKS
constTNT_FUSE_TICKS:80=80
Defined in: block-behaviors/src/families/redstone.ts:36
How long primed TNT burns before it goes off, in ticks.
TORCH_FACING
constTORCH_FACING: readonly ["unknown","west","east","north","south","top"]
Defined in: block-behaviors/src/geometry.ts:144
The torch_facing_direction domain, which names the face the torch stands on.
TORCH_SUPPORT
constTORCH_SUPPORT:Readonly<Record<string,BlockFace>>
Defined in: block-behaviors/src/families/furniture.ts:28
The support face for each Bedrock torch_facing_direction value.
Bedrock names the direction from the torch back to its support; Java's wall-torch facing state names the direction the torch points away from that support.
TREE_TRUNK_HEIGHT
constTREE_TRUNK_HEIGHT:5=5
Defined in: block-behaviors/src/families/plants.ts:214
How tall a grown tree's trunk is, and how wide its canopy reaches.
UPPER_HALF_THRESHOLD
constUPPER_HALF_THRESHOLD:0.5=0.5
Defined in: block-behaviors/src/rules/placement.ts:28
How high up a block face a click has to land to take the top half.
VANILLA_BLOCK_FAMILIES
constVANILLA_BLOCK_FAMILIES: readonlyBlockFamily[]
Defined in: block-behaviors/src/families/registry.ts:51
Every vanilla block behavior family, in the order they are registered.
WALL_CONNECTION_STATES
constWALL_CONNECTION_STATES:Readonly<Record<HorizontalFace,string>>
Defined in: block-behaviors/src/rules/connection.ts:31
The state a wall carries per direction, which holds a height rather than a flag.
WATER
constWATER:"minecraft:water"='minecraft:water'
Defined in: block-behaviors/src/identifiers.ts:17
The water source block.
WATER_SPREAD_TICKS
constWATER_SPREAD_TICKS:5=5
Defined in: block-behaviors/src/rules/fluid.ts:36
Game ticks between water spread steps.
WEATHERING_CHANCE
constWEATHERING_CHANCE:number
Defined in: block-behaviors/src/rules/weathering.ts:120
The chance one random tick advances a copper block's oxidation.
Java weights this by how many copper blocks are nearby and how oxidized they are. The weights are in a class the repository does not carry, so the family uses the flat rate the wiki measures for an isolated block.
WEATHERING_STAGES
constWEATHERING_STAGES: readonly ["","exposed","weathered","oxidized"]
Defined in: block-behaviors/src/rules/weathering.ts:12
The oxidation prefixes, in the order a block passes through them.
WEIRDO_DIRECTIONS
constWEIRDO_DIRECTIONS: readonly ["east","west","south","north"]
Defined in: block-behaviors/src/geometry.ts:131
The weirdo_direction domain stairs are placed with, which the numeric direction of a trapdoor uses too. It is a separate table from CARDINAL_DIRECTIONS because the legacy numeric state starts at east.
WORLD_DIFFICULTIES
constWORLD_DIFFICULTIES: readonly ["peaceful","easy","normal","hard"]
Defined in: block-behaviors/src/world.ts:126
The four vanilla difficulty levels in increasing order, which is also Java's difficulty id order.
ZOMBIFIED_PIGLIN
constZOMBIFIED_PIGLIN:"minecraft:zombie_pigman"='minecraft:zombie_pigman'
Defined in: block-behaviors/src/rules/portal.ts:566
The Bedrock identifier of the zombified piglin.
bambooFamily
constbambooFamily:BlockFamily
Defined in: block-behaviors/src/families/plants.ts:356
The stalks and the water plants: bamboo, kelp, chorus, coral and sea pickles.
bannerFamily
constbannerFamily:BlockFamily
Defined in: block-behaviors/src/families/furniture.ts:81
Banners, which are a sign's shape with a pattern list instead of text.
bedFamily
constbedFamily:BlockFamily
Defined in: block-behaviors/src/families/furniture.ts:125
Beds: two blocks, a color and an occupant.
buttonFamily
constbuttonFamily:BlockFamily
Defined in: block-behaviors/src/families/redstone.ts:744
Buttons, which power the block they are on for a fixed time.
cakeFamily
constcakeFamily:BlockFamily
Defined in: block-behaviors/src/families/furniture.ts:168
The cake, which loses a slice per use.
candleFamily
constcandleFamily:BlockFamily
Defined in: block-behaviors/src/families/furniture.ts:189
Candles, up to four per block, lit by flint and steel and snuffed by hand.
cauldronFamily
constcauldronFamily:BlockFamily
Defined in: block-behaviors/src/families/containers.ts:217
The cauldron, which holds one of three liquids.
A bucket moves the whole six levels and a bottle moves two, so three bottles fill what one bucket does. What the exchange gives back goes on the ground, because WorldActions has no inventory to put it in; the server picks it up from the drop or replaces the stack itself.
chemistryFamily
constchemistryFamily:BlockFamily
Defined in: block-behaviors/src/families/simple.ts:125
The Education Edition chemistry blocks, which a vanilla server does not run.
climbingFamily
constclimbingFamily:BlockFamily
Defined in: block-behaviors/src/families/plants.ts:431
Ladders, vines, chains, scaffolding and the lichens.
composterFamily
constcomposterFamily:BlockFamily
Defined in: block-behaviors/src/families/containers.ts:292
The composter, which turns a stack of plant matter into bone meal.
concretePowderFamily
constconcretePowderFamily:BlockFamily
Defined in: block-behaviors/src/families/ground.ts:96
Concrete powder: it falls like sand and sets into concrete when water touches it.
containerFamily
constcontainerFamily:BlockFamily
Defined in: block-behaviors/src/families/containers.ts:80
Chests, barrels, shulker boxes and decorated pots.
Pairing is the one rule a chest decides for itself: a chest placed beside another chest of the same kind and facing joins it into one inventory, which this family records in the block entity of both.
copperFamily
constcopperFamily:BlockFamily
Defined in: block-behaviors/src/families/world.ts:232
The copper blocks that are not a slab, a stair, a door, a trapdoor or bars.
cropFamily
constcropFamily:BlockFamily
Defined in: block-behaviors/src/families/plants.ts:153
Crops, including the two-block pitcher crop and the berry bushes.
doorFamily
constdoorFamily:BlockFamily
Defined in: block-behaviors/src/families/openable.ts:70
Doors: two blocks, a hinge, and an iron variant that only redstone opens.
doubleSlabFamily
constdoubleSlabFamily:BlockFamily
Defined in: block-behaviors/src/families/shapes.ts:76
Full cubes made of two slabs, which is what they give back.
dripleafFamily
constdripleafFamily:BlockFamily
Defined in: block-behaviors/src/families/plants.ts:534
The big and small dripleaf, which tilt under a standing entity.
dripstoneFamily
constdripstoneFamily:BlockFamily
Defined in: block-behaviors/src/families/ground.ts:270
Dripstone, amethyst and budding amethyst.
eggFamily
consteggFamily:BlockFamily
Defined in: block-behaviors/src/families/plants.ts:569
Turtle eggs, sniffer eggs and frogspawn.
fenceFamily
constfenceFamily:BlockFamily
Defined in: block-behaviors/src/families/shapes.ts:154
Fences, which join their own group and refuse the other one.
fenceGateFamily
constfenceGateFamily:BlockFamily
Defined in: block-behaviors/src/families/openable.ts:209
Fence gates, which also drop into a wall beside them.
floraFamily
constfloraFamily:BlockFamily
Defined in: block-behaviors/src/families/plants.ts:320
The one-block plants that need ground under them.
flowerPotFamily
constflowerPotFamily:BlockFamily
Defined in: block-behaviors/src/families/containers.ts:326
The flower pot, which holds one plant.
update_bit says whether the pot has contents: false is an empty pot. Taking the plant out therefore clears it. It used to set it, which left an emptied pot claiming to be full and put a minecraft:flower_pot[update_bit=1] on the wire, a state the Java-to-Bedrock table never emits. All 40 Java potted_* blocks and the empty minecraft:flower_pot collapse onto update_bit=0, because the plant travels in the block entity rather than in the state.
furnaceFamily
constfurnaceFamily:BlockFamily
Defined in: block-behaviors/src/families/containers.ts:154
Furnaces, smokers, blast furnaces, campfires and the brewing stand.
glassFamily
constglassFamily:BlockFamily
Defined in: block-behaviors/src/families/simple.ts:75
Transparent cubes, which drop themselves only to silk touch.
headFamily
constheadFamily:BlockFamily
Defined in: block-behaviors/src/families/furniture.ts:103
Heads and skulls, which hold a rotation or a profile.
iceFamily
consticeFamily:BlockFamily
Defined in: block-behaviors/src/families/ground.ts:202
Ice, packed ice and frosted ice, which melt in the light.
inertFamily
constinertFamily:BlockFamily
Defined in: block-behaviors/src/families/simple.ts:68
The blocks with no behavior at all: air, bedrock, the command blocks, the deprecated palette entries and the engine markers.
lanternFamily
constlanternFamily:BlockFamily
Defined in: block-behaviors/src/families/furniture.ts:249
Lanterns and chains, which sit on a block or hang from one.
leavesFamily
constleavesFamily:BlockFamily
Defined in: block-behaviors/src/families/plants.ts:292
Leaves, which decay when no log is within six blocks and come away to shears.
No onNeighborChanged, deliberately. Java recomputes a leaf's distance state when a neighbor changes, and Bedrock's update_bit is the engine's own marker for the same check. This server has neither: hasNearbyLog walks the canopy from scratch on every random tick, so nothing reads a scheduling flag back. Writing one cost two block writes per leaf per tick forever - the clearing write notified the six neighbors, each un-flagged leaf flagged itself again, and the canopy never settled - and every write carried a block-change packet, a light update, seven scheduled physics positions and six more neighbor notifications. Leaving the hook off also keeps leaves out of the neighbor walk entirely, because the adapter skips a block whose families declare no reaction.
liquidFamily
constliquidFamily:BlockFamily
Defined in: block-behaviors/src/families/world.ts:25
Water and lava, source and flowing.
logFamily
constlogFamily:BlockFamily
Defined in: block-behaviors/src/families/simple.ts:87
Logs, stems and the other blocks placed along an axis.
oreFamily
constoreFamily:BlockFamily
Defined in: block-behaviors/src/families/simple.ts:104
Ores, which drop an item and some experience rather than themselves.
paneFamily
constpaneFamily:BlockFamily
Defined in: block-behaviors/src/families/shapes.ts:184
Panes and bars.
No vanilla block reaches this family: the identifier rules send every _pane to jsprismarine:glass and iron_bars to jsprismarine:fence first. It stays registered because the rule exists and a pack can name it, and because the pane connection rule is what a custom thin block wants.
plainBlockFamily
constplainBlockFamily:BlockFamily
Defined in: block-behaviors/src/families/simple.ts:54
A full cube with nothing to decide but what it drops.
portalFamily
constportalFamily:BlockFamily
Defined in: block-behaviors/src/families/world.ts:92
The portal blocks, the portal frames and the two fires.
pressurePlateFamily
constpressurePlateFamily:BlockFamily
Defined in: block-behaviors/src/families/redstone.ts:779
Pressure plates, including the two that count entities.
railFamily
constrailFamily:BlockFamily
Defined in: block-behaviors/src/families/redstone.ts:816
The ten rail shapes, and the power a powered rail carries.
redstoneFamily
constredstoneFamily:BlockFamily
Defined in: block-behaviors/src/families/redstone.ts:501
The redstone components: wire, the two delays, the observer, both pistons and the rest.
saplingFamily
constsaplingFamily:BlockFamily
Defined in: block-behaviors/src/families/plants.ts:250
Saplings and the mangrove propagule.
sculkFamily
constsculkFamily:BlockFamily
Defined in: block-behaviors/src/families/world.ts:179
The sculk blocks: the catalyst, the shrieker, the sensor and the veins.
signFamily
constsignFamily:BlockFamily
Defined in: block-behaviors/src/families/furniture.ts:44
Signs: a block entity of text, editable until honeycomb waxes it.
slabFamily
constslabFamily:BlockFamily
Defined in: block-behaviors/src/families/shapes.ts:44
Half blocks.
The click position picks the half: a click in the upper half of a side face, or on the underside of a block, puts the slab on top. Placing one on the free half of the same slab makes the double block instead, which is the case where BlockPlaceEvent.previous is that slab in the other half.
snowFamily
constsnowFamily:BlockFamily
Defined in: block-behaviors/src/families/ground.ts:236
Snow layers and the snow block.
soilFamily
constsoilFamily:BlockFamily
Defined in: block-behaviors/src/families/ground.ts:135
Soil: dirt and its variants, sand and gravel, farmland and the spreading ground covers.
stairsFamily
conststairsFamily:BlockFamily
Defined in: block-behaviors/src/families/shapes.ts:104
Stairs: the placer's look direction turns them, the click position flips them, and the stairs in front and behind give them a corner.
torchFamily
consttorchFamily:BlockFamily
Defined in: block-behaviors/src/families/furniture.ts:231
Torches, which stand on a face and pop when it goes.
trapdoorFamily
consttrapdoorFamily:BlockFamily
Defined in: block-behaviors/src/families/openable.ts:156
Trapdoors: one block, opened the same way a door is.
utilityFamily
constutilityFamily:BlockFamily
Defined in: block-behaviors/src/families/containers.ts:422
The workstations, the beacon, the conduit, the spawners and the sticky and damaging blocks.
Forty-seven blocks with little in common, so the family answers the ones whose rule is a block rule: the beacon's pyramid, the anvil's fall, the spawner's timer and the blocks that hurt what stands on them.
wallFamily
constwallFamily:BlockFamily
Defined in: block-behaviors/src/families/shapes.ts:137
Walls, which take a height per side and a post.
waxOrScrapeHandler
constwaxOrScrapeHandler:NonNullable<FamilyHandlers["onPlayerInteract"]>
Defined in: block-behaviors/src/families/shared.ts:99
The onPlayerInteract handler for a copper family whose only interaction is waxing and scraping. A block that is not copper, or an item that is neither honeycomb nor an axe, declines so the next handler sees it.
Functions
activateEndPortal()
activateEndPortal(
world,frameAt):BlockPosition|undefined
Defined in: block-behaviors/src/rules/portal.ts:367
Fills the ring around a frame with end_portal when the frame completes it, overwriting whatever the 3 by 3 holds, and plays the activation sound.
Parameters
world
frameAt
Returns
BlockPosition | undefined
The center that was filled, or undefined when the ring is not complete.
advanceCounter()
advanceCounter(
world,block,state,max,chance):boolean
Defined in: block-behaviors/src/rules/growth.ts:76
Advances a counter state by one when the chance comes up.
Parameters
world
block
state
string
The state holding the counter, such as growth.
max
number
The value the counter stops at.
chance
number
The chance this tick advances it, 1 for always.
Returns
boolean
True when the counter moved.
alongPortalAxis()
alongPortalAxis(
position,axis,distance):BlockPosition
Defined in: block-behaviors/src/rules/portal.ts:108
The position distance blocks along a portal's axis, which is the direction its width runs.
Parameters
position
axis
distance
number
In blocks; negative steps toward the axis's negative side.
Returns
applyLavaReactions()
applyLavaReactions(
world,at):boolean
Defined in: block-behaviors/src/rules/fluid.ts:311
Changes lava to obsidian, cobblestone, stone, or basalt when water reaches it.
Parameters
world
at
Returns
boolean
applyLavaWaterReaction()
applyLavaWaterReaction(
world,lava):"down"|"up"|"north"|"south"|"west"|"east"|undefined
Defined in: block-behaviors/src/rules/fluid.ts:60
Turns lava to rock where adjacent water reaches it.
Parameters
world
lava
Returns
"down" | "up" | "north" | "south" | "west" | "east" | undefined
axisOfFace()
axisOfFace(
face):"x"|"y"|"z"
Defined in: block-behaviors/src/geometry.ts:161
The pillar_axis value a block takes when it is placed against a face.
Parameters
face
"down" | "up" | "north" | "south" | "west" | "east"
Returns
"x" | "y" | "z"
bareName()
bareName(
identifier):string
Defined in: block-behaviors/src/state.ts:112
The identifier with its namespace removed, which the family rules match on.
Parameters
identifier
string
Returns
string
beaconLevels()
beaconLevels(
world,position):number
Defined in: block-behaviors/src/families/containers.ts:358
How many levels of pyramid sit under a beacon.
Parameters
world
position
Returns
number
bindFamily()
bindFamily(
family,identifier,options?):FamilyHarness
Defined in: block-behaviors/src/harness.ts:270
Binds a family to one identifier against a world, ready to dispatch hooks.
Parameters
family
identifier
string
options?
HarnessOptions = {}
Returns
blockDistance()
blockDistance(
a,b):number
Defined in: block-behaviors/src/geometry.ts:96
The taxicab distance between two positions, in blocks.
Parameters
a
b
Returns
number
blockPropertiesOf()
blockPropertiesOf(
definition):BlockProperties
Defined in: block-behaviors/src/family.ts:116
The block's jsprismarine:block_properties.
A block with no such component, or one whose value the schema rejects, reads as DEFAULT_BLOCK_PROPERTIES rather than failing the load, because a behavior that cannot run is worse than one running on Bedrock's own defaults.
Parameters
definition
Returns
breakBlock()
breakBlock(
world,block,drops?,notifyNeighbors?):void
Defined in: block-behaviors/src/rules/support.ts:26
Removes a block, drops what it leaves behind and tells its neighbors.
Parameters
world
block
drops?
readonly ItemDrop[] = []
notifyNeighbors?
boolean = true
Returns
void
bucketContents()
bucketContents(
item):string|undefined
Defined in: block-behaviors/src/rules/heldItem.ts:91
What a filled bucket pours out.
Parameters
item
HookItem | undefined
Returns
string | undefined
water, lava or powder_snow, matching the cauldron's cauldron_liquid domain, or undefined when the item is not a filled bucket.
bucketOf()
bucketOf(
liquid):string
Defined in: block-behaviors/src/rules/heldItem.ts:94
The filled bucket one of BUCKET_CONTENTS's liquids goes into.
Parameters
liquid
string
Returns
string
canBurn()
canBurn(
world,block):boolean
Defined in: block-behaviors/src/rules/fire.ts:78
Whether the block catches fire at all.
Parameters
world
block
Returns
boolean
canFireSurvive()
canFireSurvive(
world,at):boolean
Defined in: block-behaviors/src/rules/fire.ts:121
Whether fire at this position can survive on its floor or beside fuel.
Parameters
world
at
Returns
boolean
canFlowInto()
canFlowInto(
world,position,liquid,depth):boolean
Defined in: block-behaviors/src/rules/fluid.ts:426
Whether a fluid can replace a block at a new depth.
Parameters
world
position
liquid
string
depth
number
Returns
boolean
cardinalFacing()
cardinalFacing(
block):"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/families/openable.ts:29
The direction a block with minecraft:cardinal_direction faces.
Parameters
block
Returns
"north" | "south" | "west" | "east"
checkBurnOut()
checkBurnOut(
world,at,chance,age):void
Defined in: block-behaviors/src/rules/fire.ts:145
Burn one adjacent block according to its resolved destroy chance.
Parameters
world
at
chance
number
age
number
Returns
void
collapseNetherPortal()
collapseNetherPortal(
world,block,face,neighbor):BlockPosition[]
Defined in: block-behaviors/src/rules/portal.ts:282
Java's NetherPortalBlock.updateShape with Dragonfly's one-go collapse: when the neighbor on a face in the portal's plane is neither a portal block nor a frame block, every connected portal block becomes air.
Parameters
world
block
face
"down" | "up" | "north" | "south" | "west" | "east"
neighbor
Returns
The positions cleared, empty when the portal stands.
comparatorInput()
comparatorInput(
world,block):number
Defined in: block-behaviors/src/families/redstone.ts:267
The signal from behind a comparator, including its analog block output.
Containers answer with their fill level, and counter states answer with their value. Redstone wire and other sources use the directional signal path so a comparator reads only the face it points toward.
Parameters
world
block
Returns
number
compassDirectionOf()
compassDirectionOf(
face):number
Defined in: block-behaviors/src/geometry.ts:141
The compass-order numeric direction value for a horizontal face.
Parameters
face
"north" | "south" | "west" | "east"
Returns
number
componentValue()
componentValue(
definition,name):unknown
Defined in: block-behaviors/src/family.ts:106
One component's raw value, or undefined when the block does not carry it.
Parameters
definition
name
string
Returns
unknown
componentsOf()
componentsOf(
definition):Readonly<Record<string,unknown>>
Defined in: block-behaviors/src/family.ts:96
The components map of a block definition.
The definition's data is parsed JSON the compiler cannot see into, so the walk down to minecraft:block.components is guarded at every step and an unexpected shape reads as a block with no components.
Parameters
definition
Returns
Readonly<Record<string, unknown>>
connectedPortalBlocks()
connectedPortalBlocks(
world,at):BlockPosition[]
Defined in: block-behaviors/src/rules/portal.ts:246
Dragonfly's connectedNetherPortal: every portal block reachable from one through other portal blocks within the portal's plane.
Steps go up, down and along the axis the starting block carries. A block whose axis is unknown steps in every horizontal direction. An unlit position returns nothing.
Parameters
world
at
Returns
connectionStates()
connectionStates(
world,kind,block):BlockStates
Defined in: block-behaviors/src/rules/connection.ts:83
The states a fence, a pane or a set of bars takes from its four neighbors.
Parameters
world
kind
block
Returns
connectsTo()
connectsTo(
world,kind,block,face):boolean
Defined in: block-behaviors/src/rules/connection.ts:58
Whether a thin block connects to the neighbor on one face.
A fence joins fences of its own group, walls, gates and solid blocks, and a nether brick fence counts as its own group so it refuses wooden ones. Panes and bars join each other, walls and solid blocks, and refuse fences.
Parameters
world
kind
block
face
"north" | "south" | "west" | "east"
Returns
boolean
containerSignal()
containerSignal(
data):number
Defined in: block-behaviors/src/rules/container.ts:64
The comparator signal a container puts out.
Java's formula: the average fullness over every slot, scaled onto 1 to 15, with 0 only for an empty container.
Parameters
data
BlockEntityData | undefined
Returns
number
copperIdentifier()
copperIdentifier(
identifier,parts):string
Defined in: block-behaviors/src/rules/weathering.ts:67
Writes the parts back into an identifier, in the namespace of the block they came from.
Parameters
identifier
string
parts
Returns
string
createVoxelWorld()
createVoxelWorld():
VoxelWorld
Defined in: block-behaviors/src/voxelWorld.ts:374
Builds an empty VoxelWorld.
Returns
cropGrowthChance()
cropGrowthChance(
world,block):number
Defined in: block-behaviors/src/rules/growth.ts:58
How likely one random tick advances a crop.
Java weights this by the farmland's moisture and by whether the rows beside the crop are planted. The moisture half is in the block state, so it is used; the row bonus needs the whole neighborhood and is left out, which makes a crop on dry farmland grow at the documented floor rate.
Parameters
world
block
Returns
number
cutsCleanly()
cutsCleanly(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:63
Whether the held item takes a block away whole rather than destroying it.
Leaves, vines and the lichens drop themselves to shears or to a silk touch tool and to nothing else, which is one rule across two families.
Parameters
item
HookItem | undefined
Returns
boolean
dampensLightMoreThan()
dampensLightMoreThan(
world,block,cutoff):boolean
Defined in: block-behaviors/src/rules/light.ts:6
Whether a block's data-driven light dampening exceeds the supplied cutoff.
Parameters
world
block
cutoff
number
Returns
boolean
defineFamily()
defineFamily(
name,summary,handlers):BlockFamily
Defined in: block-behaviors/src/family.ts:78
Names a family. The hook list comes from the handlers, so the two cannot drift.
Parameters
name
string
summary
string
handlers
Returns
depthStep()
depthStep(
identifier,dimension):number
Defined in: block-behaviors/src/rules/fluid.ts:45
How much depth one horizontal step costs for the liquid and dimension.
Parameters
identifier
string
dimension
string
Returns
number
difficultyIdOf()
difficultyIdOf(
difficulty):number
Defined in: block-behaviors/src/world.ts:132
Java's numeric id for a difficulty, 0 for peaceful through 3 for hard.
Parameters
difficulty
"normal" | "peaceful" | "easy" | "hard"
Returns
number
doorHinge()
doorHinge(
world,block,facing):boolean
Defined in: block-behaviors/src/families/openable.ts:45
The hinge a door takes when it is placed.
Bedrock puts the hinge on the right unless the block on the left is solid or another door of the same kind already hinges there, which is what makes two doors placed side by side open as a pair.
Parameters
world
block
facing
"north" | "south" | "west" | "east"
Returns
boolean
doubleSlabName()
doubleSlabName(
identifier):string
Defined in: block-behaviors/src/families/shapes.ts:18
The double slab a slab merges into, by the slab's bare name.
Parameters
identifier
string
Returns
string
dropAll()
dropAll(
world,block,drops):void
Defined in: block-behaviors/src/families/shared.ts:39
Drops a list of items at a block, leaving out the empty ones.
Parameters
world
block
drops
readonly ItemDrop[]
Returns
void
dropSelf()
dropSelf(
world,block,count?,carried?):void
Defined in: block-behaviors/src/families/shared.ts:29
Proposes one of the block itself as a drop. The content break host checks requires_correct_tool against the held item's data before releasing it.
Parameters
world
block
count?
number = 1
carried?
Omit<ItemDrop, "identifier" | "count"> = {}
What the dropped stack keeps of the block it came from, which is how a shulker box leaves with the items it was holding.
Returns
void
emptyContainer()
emptyContainer(
identifier):BlockEntityData
Defined in: block-behaviors/src/rules/container.ts:53
Creates the block entity a container starts with.
Parameters
identifier
string
Returns
enchantmentLevel()
enchantmentLevel(
item,enchantment):number
Defined in: block-behaviors/src/rules/heldItem.ts:38
The level of one enchantment on a held item.
The component value is parsed JSON the compiler cannot see into, so both the map and the level are checked rather than assumed, and an unexpected shape reads as not enchanted.
Parameters
item
HookItem | undefined
enchantment
string
A namespaced enchantment id, such as minecraft:silk_touch.
Returns
number
The level, or 0 when the item does not have the enchantment.
faceOfFacingDirection()
faceOfFacingDirection(
value):"down"|"up"|"north"|"south"|"west"|"east"|undefined
Defined in: block-behaviors/src/geometry.ts:106
The face a facing_direction value names, or undefined when it is out of range.
Parameters
value
number
Returns
"down" | "up" | "north" | "south" | "west" | "east" | undefined
facingDirectionOf()
facingDirectionOf(
face):number
Defined in: block-behaviors/src/geometry.ts:109
The facing_direction value for a face.
Parameters
face
"down" | "up" | "north" | "south" | "west" | "east"
Returns
number
facingFrom()
facingFrom(
from,to):"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/geometry.ts:150
The horizontal face an actor at from is looking toward when it clicks a block at to, taken from the larger of the two horizontal offsets.
Parameters
from
to
Returns
"north" | "south" | "west" | "east"
facingFromYaw()
facingFromYaw(
yaw):"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/geometry.ts:119
The cardinal direction a Bedrock yaw faces, rounded to the nearest quarter turn.
Parameters
yaw
number
Returns
"north" | "south" | "west" | "east"
fallOneStep()
fallOneStep(
world,block):FallStep
Defined in: block-behaviors/src/rules/gravity.ts:72
Moves a falling block down one position, or reports that it landed.
A block the falling one passes through is destroyed and drops itself, which is how a falling anvil clears a torch out of its way.
Parameters
world
block
Returns
familyBehavior()
familyBehavior(
family,world):Behavior<BlockHooks>
Defined in: block-behaviors/src/family.ts:173
Turns a family into the behavior BehaviorRegistry.register takes.
Parameters
family
world
Returns
familyContextOf()
familyContextOf(
bind,world):FamilyContext
Defined in: block-behaviors/src/family.ts:124
Builds the context one family handler set runs against.
Parameters
bind
world
Returns
familyHooks()
familyHooks(
family): readonly ("onPlace"|"onBreak"|"onNeighborChanged"|"onRandomTick"|"onTick"|"onPlayerInteract"|"onStepOn"|"onEntityFallOn"|"onEntity"|"onRedstoneUpdate"|"onBlockStateChange")[]
Defined in: block-behaviors/src/family.ts:85
Every hook a family implements, in BLOCK_HOOK_NAMES order.
Parameters
family
Returns
readonly ("onPlace" | "onBreak" | "onNeighborChanged" | "onRandomTick" | "onTick" | "onPlayerInteract" | "onStepOn" | "onEntityFallOn" | "onEntity" | "onRedstoneUpdate" | "onBlockStateChange")[]
findEmptyPortalShape()
findEmptyPortalShape(
world,at):PortalFrame|undefined
Defined in: block-behaviors/src/rules/portal.ts:187
Java's PortalShape.findEmptyPortalShape: the unlit frame around a position, trying the x axis and then the z axis.
The interior may hold air, fire or nothing else, 2 to 21 blocks wide and 3 to 21 tall, and the corners of the frame are not checked.
Parameters
world
at
A position inside the frame, which is where the fire appeared.
Returns
PortalFrame | undefined
The frame, or undefined when no valid, unlit frame surrounds the position.
findEndPortalRing()
findEndPortalRing(
world,frameAt):BlockPosition|undefined
Defined in: block-behaviors/src/rules/portal.ts:342
Java's end portal frame pattern as Bedrock accepts it, the flat ring only: twelve end_portal_frame blocks around a 3 by 3, every one holding an eye and facing the center.
The frame's own facing says which side of the ring it is on, so there are three centers to try, two blocks inward and up to one block sideways.
Parameters
world
frameAt
The frame that was just filled.
Returns
BlockPosition | undefined
The center of the 3 by 3 the ring surrounds, or undefined when no complete ring includes the frame.
fireOddsOf()
fireOddsOf(
world,block):BlockFlammability
Defined in: block-behaviors/src/rules/fire.ts:75
The chance modifiers of one block state, or zeroes when it is fireproof.
Parameters
world
block
Returns
fireTick()
fireTick(
world,at,dimension,options?):void
Defined in: block-behaviors/src/rules/fire.ts:174
Run Java's scheduled fire tick: reschedule, survive, burn neighbors, and spread.
Parameters
world
The block actions for the fire's dimension.
at
The fire's position.
dimension
string
The namespaced dimension identifier, which selects its infiniburn tag.
options?
FireTickOptions = {}
Overrides for environment facts a host supplies through the world actions.
Returns
void
fireTickDelay()
fireTickDelay(
world):number
Defined in: block-behaviors/src/rules/fire.ts:133
The first fire tick, 30 to 39 game ticks after placement.
Parameters
world
Returns
number
flowingForm()
flowingForm(
identifier):string
Defined in: block-behaviors/src/identifiers.ts:62
The flowing form of a liquid, which is the block a spread writes.
Parameters
identifier
string
Returns
string
fluidNeighborChanged()
fluidNeighborChanged(
world,block):void
Defined in: block-behaviors/src/rules/fluid.ts:460
Schedules a fluid after a neighboring block changed, unless lava already reacted.
Parameters
world
block
Returns
void
fluidTick()
fluidTick(
world,block):SpreadResult
Defined in: block-behaviors/src/rules/fluid.ts:437
Recomputes a flowing block's depth, removes it when empty, and spreads it.
Parameters
world
block
Returns
fortuneLevel()
fortuneLevel(
item):number
Defined in: block-behaviors/src/rules/heldItem.ts:49
The fortune level on the held item, which multiplies an ore's drop.
Parameters
item
HookItem | undefined
Returns
number
growTree()
growTree(
world,block,species):void
Defined in: block-behaviors/src/families/plants.ts:224
Grows the tree a sapling becomes.
The shape is a trunk with a two-layer canopy, which is the oak outline. The real species features live in the feature runtime; this is enough for the sapling's own rule to be observable and tested, and it is the one deliberately provisional piece of this package.
Parameters
world
block
species
string
Returns
void
hasNearbyLog()
hasNearbyLog(
world,block):boolean
Defined in: block-behaviors/src/rules/growth.ts:175
Whether a log near enough to hold a leaf block up is within MAX_LEAF_DISTANCE of it.
Breadth first through leaves only, so leaves hanging off a trunk keep each other alive and a floating canopy does not. A position the server cannot read counts as holding the leaf up, which is the answer in MAX_LEAF_DISTANCE's terms: the search cannot prove the canopy is orphaned without the chunk next door, and Java never has to decide, because LevelAccessor.getBlockState loads it. Guessing the other way strips the canopy off every tree on the edge of the loaded world. BlockPhysics makes the same assumption about ground it cannot read.
Parameters
world
block
Returns
boolean
hasSilkTouch()
hasSilkTouch(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:46
Whether the held item is enchanted with silk touch, which makes a block drop itself.
Parameters
item
HookItem | undefined
Returns
boolean
hasState()
hasState(
block,name):boolean
Defined in: block-behaviors/src/state.ts:41
Whether the block carries a state under this name.
Parameters
block
name
string
Returns
boolean
heldItem()
heldItem(
identifier,components?):TestItem
Defined in: block-behaviors/src/harness.ts:70
A held item for a test, from an identifier and its components.
Parameters
identifier
string
components?
Readonly<Record<string, unknown>> = {}
Returns
heldName()
heldName(
item):string
Defined in: block-behaviors/src/rules/heldItem.ts:19
The bare name of a held item, empty for a bare hand.
Parameters
item
HookItem | undefined
Returns
string
igniteOddsAround()
igniteOddsAround(
world,at):number
Defined in: block-behaviors/src/rules/fire.ts:102
The maximum ignite odds around an empty position.
Parameters
world
at
Returns
number
incomingPower()
incomingPower(
world,position):number
Defined in: block-behaviors/src/rules/redstone.ts:31
The strongest power reaching a position from itself or any of its six faces.
Parameters
world
position
Returns
number
isAir()
isAir(
identifier):boolean
Defined in: block-behaviors/src/identifiers.ts:38
Whether the identifier is air, which is what an empty position reads as.
Parameters
identifier
string
Returns
boolean
isAxe()
isAxe(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:52
Whether the held item is an axe of any material, which scrapes copper.
Parameters
item
HookItem | undefined
Returns
boolean
isEmptyBucket()
isEmptyBucket(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:75
Whether the held item is an empty bucket, which picks a liquid up.
Parameters
item
HookItem | undefined
Returns
boolean
isEndPortalFrame()
isEndPortalFrame(
identifier):boolean
Defined in: block-behaviors/src/rules/portal.ts:85
Whether the identifier is an end portal frame block.
Parameters
identifier
string
Returns
boolean
isFallThrough()
isFallThrough(
world,block):boolean
Defined in: block-behaviors/src/rules/gravity.ts:41
Whether a falling block can move into a position rather than landing on it.
Parameters
world
block
Returns
boolean
isFallingBlock()
isFallingBlock(
identifier):boolean
Defined in: block-behaviors/src/rules/gravity.ts:27
The blocks that fall.
Java decides this by class and publishes no list, so the rule is written out: the two loose ground blocks, the sixteen concrete powders, the three anvils, the dragon egg and the two suspicious blocks the brush uses.
Parameters
identifier
string
Returns
boolean
isGlassBottle()
isGlassBottle(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:97
Whether the held item is an empty glass bottle, which scoops one bottle of water.
Parameters
item
HookItem | undefined
Returns
boolean
isHoneycomb()
isHoneycomb(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:66
Whether the held item is honeycomb, which waxes copper and seals a sign.
Parameters
item
HookItem | undefined
Returns
boolean
isHydrated()
isHydrated(
world,block):boolean
Defined in: block-behaviors/src/families/ground.ts:68
Whether water is within FARMLAND_WATER_RANGE of a farmland block.
Parameters
world
block
Returns
boolean
isIgniter()
isIgniter(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:69
Whether the held item sets something alight: flint and steel or a fire charge.
Parameters
item
HookItem | undefined
Returns
boolean
isIronOperated()
isIronOperated(
identifier):boolean
Defined in: block-behaviors/src/families/shared.ts:103
Whether an identifier names an iron block, which refuses a bare hand.
Parameters
identifier
string
Returns
boolean
isLava()
isLava(
identifier):boolean
Defined in: block-behaviors/src/identifiers.ts:47
Whether the identifier is lava, source or flowing.
Parameters
identifier
string
Returns
boolean
isLiquid()
isLiquid(
identifier):boolean
Defined in: block-behaviors/src/identifiers.ts:53
Whether the identifier is either liquid.
Parameters
identifier
string
Returns
boolean
isLiquidSource()
isLiquidSource(
identifier):boolean
Defined in: block-behaviors/src/identifiers.ts:56
Whether the identifier is a liquid's source block rather than its flowing one.
Parameters
identifier
string
Returns
boolean
isLogName()
isLogName(
identifier):boolean
Defined in: block-behaviors/src/rules/growth.ts:120
Whether an identifier names a log, which is what holds leaves up.
Java asks #minecraft:prevents_nearby_leaf_decay, which is #minecraft:logs and expands to every _log, _wood, _stem and _hyphae, stripped forms included. mushroom_stem carries the suffix and is not in the tag, so it is named out.
Parameters
identifier
string
Returns
boolean
isNearRain()
isNearRain(
world,at):boolean
Defined in: block-behaviors/src/rules/fire.ts:127
Whether rain reaches this position or one of its four horizontal neighbors.
Parameters
world
at
Returns
boolean
isNetherPortal()
isNetherPortal(
identifier):boolean
Defined in: block-behaviors/src/rules/portal.ts:79
Whether the identifier is a lit nether portal block.
Parameters
identifier
string
Returns
boolean
isNetherPortalFrame()
isNetherPortalFrame(
identifier):boolean
Defined in: block-behaviors/src/rules/portal.ts:82
Whether the identifier is a nether portal frame block.
Parameters
identifier
string
Returns
boolean
isPortalLightingFire()
isPortalLightingFire(
identifier):boolean
Defined in: block-behaviors/src/rules/portal.ts:88
Whether the identifier is one of the fires that light a portal.
Parameters
identifier
string
Returns
boolean
isPowered()
isPowered(
world,position):boolean
Defined in: block-behaviors/src/rules/redstone.ts:38
Whether any power reaches a position.
Parameters
world
position
Returns
boolean
isReplaceable()
isReplaceable(
identifier):boolean
Defined in: block-behaviors/src/identifiers.ts:99
Whether a placement overwrites the block rather than being refused.
Parameters
identifier
string
Returns
boolean
isShears()
isShears(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:55
Whether the held item is shears, which cut leaves and vines loose.
Parameters
item
HookItem | undefined
Returns
boolean
isSolidSupport()
isSolidSupport(
world,position):boolean
Defined in: block-behaviors/src/rules/support.ts:18
Whether a block at a position can hold another block up.
Parameters
world
position
Returns
boolean
isStairs()
isStairs(
identifier):boolean
Defined in: block-behaviors/src/rules/stairShape.ts:23
Whether an identifier names a stair block.
Parameters
identifier
string
Returns
boolean
isValidFireLocation()
isValidFireLocation(
world,at):boolean
Defined in: block-behaviors/src/rules/fire.ts:114
Whether any of the six adjacent blocks can catch fire.
Parameters
world
at
Returns
boolean
isVertical()
isVertical(
face):boolean
Defined in: block-behaviors/src/geometry.ts:158
Whether a face points along the Y axis.
Parameters
face
"down" | "up" | "north" | "south" | "west" | "east"
Returns
boolean
isWater()
isWater(
identifier):boolean
Defined in: block-behaviors/src/identifiers.ts:41
Whether the identifier is water, source or flowing.
Parameters
identifier
string
Returns
boolean
isWaterBottle()
isWaterBottle(
item):boolean
Defined in: block-behaviors/src/rules/heldItem.ts:106
Whether the held item is a bottle of water rather than a brewed potion.
A water bottle is minecraft:potion whose minecraft:potion_contents names water. The component is absent on a stack that never went through brewing, which is also water, so an absent component counts.
Parameters
item
HookItem | undefined
Returns
boolean
isWaxedCopper()
isWaxedCopper(
identifier):boolean
Defined in: block-behaviors/src/families/shared.ts:63
Whether honeycomb has already sealed a copper block against oxidation.
Parameters
identifier
string
Returns
boolean
isWeatheringCopper()
isWeatheringCopper(
identifier):boolean
Defined in: block-behaviors/src/families/shared.ts:60
Whether a block is one of the copper blocks that oxidize.
Parameters
identifier
string
Returns
boolean
lavaWaterProduct()
lavaWaterProduct(
lava,fromAbove):string|undefined
Defined in: block-behaviors/src/rules/fluid.ts:53
What lava turns into when water reaches it.
Parameters
lava
fromAbove
boolean
Returns
string | undefined
lightNetherPortal()
lightNetherPortal(
world,at,dimension):PortalFrame|undefined
Defined in: block-behaviors/src/rules/portal.ts:210
Lights the frame around a fire, if there is one: writes minecraft:portal with the frame's portal_axis into every interior block.
Refuses in the End, where no nether portal can be lit.
Parameters
world
at
dimension
string
The dimension the fire is in.
Returns
PortalFrame | undefined
The frame that was lit, or undefined when nothing happened.
liquidStateOf()
liquidStateOf(
block):LiquidState|undefined
Defined in: block-behaviors/src/rules/fluid.ts:95
Reads a liquid block's kind, depth, falling state, and source state.
Parameters
block
Pick<HookBlock, "identifier" | "states"> | undefined
Returns
LiquidState | undefined
namespaceOf()
namespaceOf(
identifier):string
Defined in: block-behaviors/src/state.ts:124
The identifier's namespace, minecraft for a vanilla block.
Parameters
identifier
string
Returns
string
offset()
offset(
position,face,distance?):BlockPosition
Defined in: block-behaviors/src/geometry.ts:83
The position distance blocks along a face.
Parameters
position
face
"down" | "up" | "north" | "south" | "west" | "east"
distance?
number = 1
Blocks to step, which may be negative to step backwards.
Returns
opposite()
The face across the block from this one.
The horizontal overload keeps a horizontal face horizontal, so a caller that already knows it has one does not have to narrow the result back.
Call Signature
opposite(
face):"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/geometry.ts:47
The horizontal face across the block, which stays horizontal.
Parameters
face
"north" | "south" | "west" | "east"
Returns
"north" | "south" | "west" | "east"
Call Signature
opposite(
face):"down"|"up"|"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/geometry.ts:49
The face across the block from this one.
Parameters
face
"down" | "up" | "north" | "south" | "west" | "east"
Returns
"down" | "up" | "north" | "south" | "west" | "east"
otherHalf()
otherHalf(
block):BlockPosition
Defined in: block-behaviors/src/families/openable.ts:35
The other half of a door: the upper block from the lower one and back.
Parameters
block
Returns
pairedPosition()
pairedPosition(
data):BlockPosition|undefined
Defined in: block-behaviors/src/families/containers.ts:24
The position a chest's block entity records as its pair, or undefined when it has none. The value comes back out of an open record, so it is checked rather than assumed.
Parameters
data
BlockEntityData | undefined
Returns
BlockPosition | undefined
parseCopperName()
parseCopperName(
identifier):CopperName|undefined
Defined in: block-behaviors/src/rules/weathering.ts:50
Reads a copper block's identifier into its parts.
Parameters
identifier
string
Returns
CopperName | undefined
Undefined for a name that holds copper but does not oxidize.
patchStates()
patchStates(
block,patch):BlockStates
Defined in: block-behaviors/src/state.ts:49
The block's states with a patch applied.
A patch entry whose value is undefined is left out, so a caller can write a conditional patch without building the object twice.
Parameters
block
patch
Readonly<Record<string, BlockStateValue | undefined>>
Returns
performPull()
performPull(
world,origin,face,notifyNeighbors?):boolean
Defined in: block-behaviors/src/rules/piston.ts:295
Pulls the block in front of a retracting sticky piston back one position.
A block whose reaction is push moves only when something pushes it, so a sticky piston leaves it behind.
Parameters
world
origin
face
"down" | "up" | "north" | "south" | "west" | "east"
notifyNeighbors?
boolean = true
Returns
boolean
True when a block came back.
performPush()
performPush(
world,origin,face,notifyNeighbors?):boolean
Defined in: block-behaviors/src/rules/piston.ts:256
Runs a planned push: the far block moves first, so each one lands in a position the previous move emptied.
Parameters
world
origin
face
"down" | "up" | "north" | "south" | "west" | "east"
notifyNeighbors?
boolean = true
Returns
boolean
True when the line moved.
piglinSpawnRoll()
piglinSpawnRoll(
random,difficultyId):boolean
Defined in: block-behaviors/src/rules/portal.ts:581
Java's zombified piglin spawn roll on a portal's random tick: one chance in 2000 on easy, two on normal, three on hard, none on peaceful.
Parameters
random
() => number
A draw in [0, 1).
difficultyId
number
Java's difficulty id, 0 for peaceful through 3 for hard.
Returns
boolean
placedHalf()
placedHalf(
event):BlockHalf|undefined
Defined in: block-behaviors/src/rules/placement.ts:56
Which half of the block the placement lands in, which is a slab's minecraft:vertical_half and a stair's upside_down_bit.
Clicking the underside of a block always takes the top half and clicking the top always takes the bottom one. A click on a side takes whichever half it landed in.
Parameters
event
Returns
BlockHalf | undefined
Undefined when the event has no face to read the half off.
placementAxis()
placementAxis(
event):"x"|"y"|"z"|undefined
Defined in: block-behaviors/src/rules/placement.ts:40
The axis a pillar takes from the placement.
The clicked face decides it: a click on the top or bottom of a block makes the pillar vertical, and a click on a side makes it lie along that side. With no face the placer's look direction stands in, which keeps a horizontal placement right and leaves a vertical one on the default axis.
Parameters
event
Returns
"x" | "y" | "z" | undefined
Undefined when the event has neither a face nor a placer.
placementFacing()
placementFacing(
event):"north"|"south"|"west"|"east"|undefined
Defined in: block-behaviors/src/rules/placement.ts:71
The horizontal direction a placement faces, which is where the placer was looking rather than which face was clicked.
Parameters
event
Returns
"north" | "south" | "west" | "east" | undefined
Undefined for a placement the world itself performed.
planPush()
planPush(
world,origin,face):PushPlan
Defined in: block-behaviors/src/rules/piston.ts:100
Works out which blocks a piston at origin would move.
Parameters
world
origin
face
"down" | "up" | "north" | "south" | "west" | "east"
The direction the piston points, which is where the head goes.
Returns
popBlock()
popBlock(
world,block,notifyNeighbors?):void
Defined in: block-behaviors/src/rules/support.ts:46
Removes a block the way the world does it, which is what losing support, a piston and a falling anvil all do to the block in the way.
The drop is Java's table for the block, rolled by the world through WorldActions.destroyBlock. One of the block itself is only the stand-in for a world that has no table to roll, and it is a guess: deepslate yields cobbled deepslate and a popped crop yields its seeds, neither of which is one of itself.
Parameters
world
block
notifyNeighbors?
boolean = true
Returns
void
popWithoutGround()
popWithoutGround(
world,block,names,tag?):boolean
Defined in: block-behaviors/src/rules/support.ts:77
Breaks a block unless the block it stands on is ground it accepts.
Parameters
world
block
names
ReadonlySet<string>
Bare names, such as farmland, that the block accepts below it. Read only when no tag is given or the host answers no tags, which is what makes them a fallback.
tag?
string
The Java tag the ground belongs to, such as minecraft:supports_crops, which is the rule itself wherever the host can resolve one.
Returns
boolean
True when the block popped.
popWithoutSupport()
popWithoutSupport(
world,block,face?,notifyNeighbors?):boolean
Defined in: block-behaviors/src/rules/support.ts:57
Breaks a block that lost the face it was attached to.
Parameters
world
block
face?
"down" | "up" | "north" | "south" | "west" | "east" = 'down'
Where the support is, down for a block standing on another.
notifyNeighbors?
boolean = true
Returns
boolean
True when the block popped.
portalAxisOf()
portalAxisOf(
block):PortalAxis|undefined
Defined in: block-behaviors/src/rules/portal.ts:225
The portal_axis a portal block carries, or undefined for unknown, which a command wrote.
Parameters
block
Pick<HookBlock, "states">
Returns
PortalAxis | undefined
portalCreationSite()
portalCreationSite(
world,target,axis,bounds):PortalCreationSite
Defined in: block-behaviors/src/rules/portal.ts:449
Java's PortalForcer.createPortal search: where a portal for target goes.
Every column within PORTAL_CREATION_RADIUS is walked from the top down for a replaceable run standing on a solid floor with room for the 4 by 5 frame. The first pass wants the footprint and one block on each side of it; the second pass, used only when the first finds nothing, wants the footprint alone. The closest candidate by 3D distance wins. When neither pass finds anything the portal is forced one block back along the axis from the target, with y clamped to [70, maxY - 10], and the caller writes a platform under it.
Parameters
world
target
The scaled arrival position in the destination dimension.
axis
The source portal's axis, which the new portal keeps.
bounds
Returns
portalInterior()
portalInterior(
frame):BlockPosition[]
Defined in: block-behaviors/src/rules/portal.ts:191
Every interior position of a frame, column by column from the bottom left.
Parameters
frame
Returns
registerVanillaBlockBehaviors()
registerVanillaBlockBehaviors(
registry,world):void
Defined in: block-behaviors/src/families/registry.ts:113
Registers every family and attaches it to definitions whose jsprismarine:behavior component names that family. Definitions without the component receive no vanilla behavior.
Parameters
registry
The registry resolveBlocks is given.
world
What the behaviors act on. The server passes its own dimensions; a test passes a VoxelWorld.
Returns
void
replaceKeepingStates()
replaceKeepingStates(
world,block,identifier):void
Defined in: block-behaviors/src/state.ts:103
Replaces a block with another identifier, carrying its current states over.
Parameters
world
block
identifier
string
Returns
void
rotateClockwise()
The face a quarter turn clockwise when seen from above.
Call Signature
rotateClockwise(
face):"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/geometry.ts:61
The horizontal face a quarter turn clockwise, which stays horizontal.
Parameters
face
"north" | "south" | "west" | "east"
Returns
"north" | "south" | "west" | "east"
Call Signature
rotateClockwise(
face):"down"|"up"|"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/geometry.ts:63
The face a quarter turn clockwise; a vertical face is unchanged.
Parameters
face
"down" | "up" | "north" | "south" | "west" | "east"
Returns
"down" | "up" | "north" | "south" | "west" | "east"
rotateCounterClockwise()
The face a quarter turn counterclockwise when seen from above.
Call Signature
rotateCounterClockwise(
face):"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/geometry.ts:70
The horizontal face a quarter turn counterclockwise, which stays horizontal.
Parameters
face
"north" | "south" | "west" | "east"
Returns
"north" | "south" | "west" | "east"
Call Signature
rotateCounterClockwise(
face):"down"|"up"|"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/geometry.ts:72
The face a quarter turn counterclockwise; a vertical face is unchanged.
Parameters
face
"down" | "up" | "north" | "south" | "west" | "east"
Returns
"down" | "up" | "north" | "south" | "west" | "east"
samePosition()
samePosition(
a,b):boolean
Defined in: block-behaviors/src/geometry.ts:93
Whether two positions name the same block.
Parameters
a
b
Returns
boolean
scaffoldingStates()
scaffoldingStates(
world,block):Record<string,number|boolean>
Defined in: block-behaviors/src/families/plants.ts:521
The stability distance scaffolding takes from the supported block nearest it.
Parameters
world
block
Returns
Record<string, number | boolean>
scheduleFall()
scheduleFall(
world,block):boolean
Defined in: block-behaviors/src/rules/gravity.ts:52
Asks for the tick that moves a block down, when the space below is free.
Parameters
world
block
Returns
boolean
True when a fall was scheduled.
scrapedIdentifier()
scrapedIdentifier(
identifier):string|undefined
Defined in: block-behaviors/src/rules/weathering.ts:94
The block an axe scrape produces: one stage back, or the unwaxed block when it was waxed, which is the order Bedrock applies the two.
Parameters
identifier
string
Returns
string | undefined
Undefined when there is nothing to scrape off.
selfDrop()
selfDrop(
block,count?):ItemDrop
Defined in: block-behaviors/src/families/shared.ts:108
The item a block drops under its own name, which is the usual case.
Parameters
block
count?
number = 1
Returns
setStates()
setStates(
world,block,patch):void
Defined in: block-behaviors/src/state.ts:93
Rewrites a block in place with some of its states changed, keeping its identifier and every state the patch leaves out.
A patch that moves nothing writes nothing. The write is not free: it notifies the six neighbors, so the five families that recompute a derived state on a neighbor change without comparing first - the wall, fence and pane connections, scaffolding's stability, the campfire's extinguished - each rewrote their unchanged value and notified back, and a settled run never reached a fixed point. One notification on a settled four-block scaffolding run spent 9.5 seconds inside a single tick before the chained-update cap of one million stopped it.
The stairs corner, the fence gate's in_wall_bit and the redstone diodes already compared before writing; this is that check in the one place they all go through.
Parameters
world
block
patch
Readonly<Record<string, BlockStateValue | undefined>>
Returns
void
sibling()
sibling(
identifier,name):string
Defined in: block-behaviors/src/state.ts:130
Puts a bare name back in its namespace, which is how a family names a sibling block.
Parameters
identifier
string
name
string
Returns
string
silkTouchTool()
silkTouchTool(
identifier?):TestItem
Defined in: block-behaviors/src/harness.ts:74
A tool enchanted with silk touch, which is what makes glass, ice and leaves drop themselves.
Parameters
identifier?
string = 'minecraft:diamond_pickaxe'
Returns
singleDimensionWorld()
singleDimensionWorld(
actions):BlockWorld
Defined in: block-behaviors/src/world.ts:296
Presents one WorldActions as a BlockWorld with a single dimension.
Parameters
actions
Returns
singleSlabName()
singleSlabName(
identifier):string
Defined in: block-behaviors/src/families/shapes.ts:26
The slab a double slab is made of, which is what breaking one gives back.
Parameters
identifier
string
Returns
string
slotsOf()
slotsOf(
identifier):number
Defined in: block-behaviors/src/rules/container.ts:46
The slot count for a block, with 27 for an unlisted container.
Parameters
identifier
string
Returns
number
spawnPiglinFromPortal()
spawnPiglinFromPortal(
world,block):number|undefined
Defined in: block-behaviors/src/rules/portal.ts:606
Rolls and performs the zombified piglin spawn for a portal block's random tick. Bedrock places the piglin beside the portal rather than in it: south of a portal running east to west, east of one running north to south, next to the bottom block of the column.
Only an Overworld portal spawns them, and only when the world's difficulty is above peaceful.
Parameters
world
block
Returns
number | undefined
The spawned entity's id, or undefined when nothing spawned.
spillContainer()
spillContainer(
world,block):void
Defined in: block-behaviors/src/rules/container.ts:79
Drops everything a container holds, which is what breaking one does.
Parameters
world
block
Returns
void
spreadLiquid()
spreadLiquid(
world,block):SpreadResult
Defined in: block-behaviors/src/rules/fluid.ts:466
Runs one fluid's flow step, returning the directions that received fluid.
Parameters
world
block
Returns
spreadTicks()
spreadTicks(
identifier,dimension):number
Defined in: block-behaviors/src/rules/fluid.ts:49
The scheduled delay for one fluid's next spread step in a dimension.
Parameters
identifier
string
dimension
string
Returns
number
stairCorner()
stairCorner(
world,block):"none"|"inner_left"|"inner_right"|"outer_left"|"outer_right"
Defined in: block-behaviors/src/rules/stairShape.ts:54
The corner a stair takes from its neighbors.
Parameters
world
block
Returns
"none" | "inner_left" | "inner_right" | "outer_left" | "outer_right"
stairFacing()
stairFacing(
block):"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/rules/stairShape.ts:26
The direction a stair's weirdo_direction names.
Parameters
block
Returns
"north" | "south" | "west" | "east"
stateBoolean()
stateBoolean(
block,name,fallback?):boolean
Defined in: block-behaviors/src/state.ts:25
A state value as a boolean, counting any nonzero number as true.
Parameters
block
name
string
fallback?
boolean = false
Returns
boolean
stateNumber()
stateNumber(
block,name,fallback?):number
Defined in: block-behaviors/src/state.ts:13
A state value as a number, with 0 and 1 for a boolean.
Parameters
block
Pick<HookBlock, "states">
name
string
fallback?
number = 0
Returns
number
stateString()
stateString(
block,name,fallback?):string
Defined in: block-behaviors/src/state.ts:34
A state value as a string, with numbers and booleans printed.
Parameters
block
name
string
fallback?
string = ''
Returns
string
testDefinition()
testDefinition(
identifier,components?):Definition
Defined in: block-behaviors/src/harness.ts:98
Builds the definition a block type would resolve from, for one identifier.
Parameters
identifier
string
components?
Readonly<Record<string, unknown>> = {}
Returns
torchSupport()
torchSupport(
facing):"down"|"up"|"north"|"south"|"west"|"east"
Defined in: block-behaviors/src/families/furniture.ts:38
The face a torch's support is on, falling back to the floor.
Parameters
facing
string
Returns
"down" | "up" | "north" | "south" | "west" | "east"
wallStates()
wallStates(
world,block):BlockStates
Defined in: block-behaviors/src/rules/connection.ts:100
The states a wall takes from its neighbors.
A connection is tall when a solid block sits on the wall, which is the rule that makes a wall under a slab reach up to it, and the post bit is set when the wall is not a straight run of exactly two opposite connections.
Parameters
world
block
Returns
waxOrScrapeOnInteract()
waxOrScrapeOnInteract(
world,block,item):boolean
Defined in: block-behaviors/src/families/shared.ts:76
Waxes a copper block with honeycomb or scrapes one with an axe.
An axe takes the wax off first and only oxidation after, which is the order Bedrock applies the two, so scraping a waxed weathered block twice gets back to exposed copper.
Parameters
world
block
item
HookItem | undefined
Returns
boolean
True when the item changed the block, which is what the handler returns to consume the interaction. False leaves the interaction for the next handler and for the item's own use.
waxedIdentifier()
waxedIdentifier(
identifier):string|undefined
Defined in: block-behaviors/src/rules/weathering.ts:107
The block honeycomb produces.
Parameters
identifier
string
Returns
string | undefined
Undefined when the block is already waxed or does not weather.
weatherOnRandomTick()
weatherOnRandomTick(
world,block):boolean
Defined in: block-behaviors/src/families/shared.ts:51
Advances a copper block one oxidation stage, at the rate an isolated block weathers.
Parameters
world
block
Returns
boolean
True when the block oxidized.
weatheredIdentifier()
weatheredIdentifier(
identifier):string|undefined
Defined in: block-behaviors/src/rules/weathering.ts:82
The block one oxidation step further along.
Parameters
identifier
string
Returns
string | undefined
Undefined when the block is waxed, fully oxidized, or not a weathering copper block at all.
weightedPlateSignal()
weightedPlateSignal(
entities,perSignal):number
Defined in: block-behaviors/src/rules/redstone.ts:67
The analog signal a weighted pressure plate puts out.
Parameters
entities
number
How many entities stand on the plate.
perSignal
number
Entities per step: 1 for the light plate, 10 for the heavy one.
Returns
number
wireSignal()
wireSignal(
world,block):number
Defined in: block-behaviors/src/rules/redstone.ts:47
The signal a wire takes from its surroundings.
A wire one block from a source carries one less than the source, so a run fades over fifteen blocks. A neighboring wire contributes its own signal minus one; a power source contributes its full strength.
Parameters
world
block
Returns
number
writeEndPlatform()
writeEndPlatform(
world,center):void
Defined in: block-behaviors/src/rules/portal.ts:547
Java's EndPlatformFeature.createEndPlatform: 5 by 5 obsidian one block under center and air in the three rows above it. A block that is not already what the platform wants is destroyed with its drops first, so the platform can be regenerated on every arrival.
Parameters
world
center
The arrival block, (100, 49, 0) for a player in the End.
Returns
void
writeNetherPortal()
writeNetherPortal(
world,site,axis,forced):void
Defined in: block-behaviors/src/rules/portal.ts:510
Writes a new 4 by 5 nether portal, corners included, with its six interior blocks lit on axis.
When the site was forced, a platform goes under it first: obsidian under the interior and one block to each side, netherrack beyond that along the whole frame as Bedrock does, and three blocks of air above the platform so there is room to stand on both sides. Nothing is notified; the server that created the portal sends the chunk.
Parameters
world
site
The bottom-left interior block, from portalCreationSite.
axis
forced
boolean
Returns
void