Skip to main content
Version: Minecraft 26.2

All functions

Generated

This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.

Every public constructor and method of the API in one list, by package: what it returns, the first sentence of its description, and the release that added it. The name links to its full entry: signature, every parameter, the return value, the exceptions, when to call it and on which thread.

client​

FunctionReturnsDescriptionSince
BlockEntityCanvas.animationTime()floatWorld time plus the partial tick, for smooth animation.0.1.0-alpha.4 or earlier
BlockEntityCanvas.block(BlockStateView, double, double, double, float, float)voidDraws the block model of state, for example a lamp that is lit, placed like block(ResourceId, double, double, double, float, float).0.1.0-alpha.4 or earlier
BlockEntityCanvas.block(ResourceId, double, double, double, float, float)voidDraws the block model of block's default state, centred on x, y, z and turned yawDegrees around the vertical axis; scale 1 is full block size.0.1.0-alpha.4 or earlier
BlockEntityCanvas.defaultState(ResourceId)BlockStateViewThe default state of block, to change with BlockStateView.with and draw with block(BlockStateView, double, double, double, float, float).0.1.0-alpha.4 or earlier
BlockEntityCanvas.item(ResourceId, double, double, double, float, float)voidDraws an item as in an item frame.0.1.0-alpha.4 or earlier
BlockEntityCanvas.quads(ShaderPipeline, Consumer<VertexSink>)voidQuads drawn with a mod shader pipeline, four vertices per quad, in the same coordinates as the other draws (the block's lowest corner is 0, 0, 0).0.1.0-alpha.4 or earlier
BlockEntityCanvas.text(String, double, double, double, float, int)voidDraws text centred at the position, facing the camera.0.1.0-alpha.4 or earlier
BlockEntityPainter.paint(BlockEntityView, BlockEntityCanvas)voidDraws for one block entity; canvas is placed at the block's lowest corner.0.1.0-alpha.4 or earlier
ClientConnectionListener.onConnection(ClientView)voidCalled on the client thread when the client joins or leaves a world.0.1.0-alpha.4 or earlier
ClientRegistrar.blockEntityRenderer(ResourceId, BlockEntityPainter)voidDraws extra things for a mod block that has a block entity.0.1.0-alpha.4 or earlier
ClientRegistrar.dynamicTexture(String, int, int)DynamicTextureDeclares a texture with pixels set by code, <mod id>:dynamic/<path>.0.1.0-alpha.4 or earlier
ClientRegistrar.hudLayer(String, HudLayer)voidAdds a layer drawn over the game's HUD every frame, after the game's own layers, in registration order.0.1.0-alpha.4 or earlier
ClientRegistrar.keyBinding(String, int)KeyBindingDeclares a key binding that players can rebind in Controls.0.1.0-alpha.4 or earlier
ClientRegistrar.shaderPipeline(String, ShaderPipelineDefinition)ShaderPipelineDeclares render pipeline <mod id>:<path> using the mod's own core shader, for WorldCanvas.quads and BlockEntityCanvas.quads.0.1.0-alpha.4 or earlier
ClientRegistrar.worldPainter(String, WorldPainter)voidDraws in the world every frame with painter.0.1.0-alpha.4 or earlier
ClientTickListener.onClientTick(ClientView)voidCalled at the end of each client tick.0.1.0-alpha.4 or earlier
ClientView.cameraPerspective()CameraPerspectiveThe camera perspective.0.1.0-alpha.4 or earlier
ClientView.clearPostEffect()voidRemoves the post effect.0.1.0-alpha.4 or earlier
ClientView.closeScreen()voidCloses the open screen, if any, returning to the game.0.1.0-alpha.4 or earlier
ClientView.isScreenOpen()booleanWhether any screen (menu, inventory, chat, mod screen) is open.0.1.0-alpha.4 or earlier
ClientView.leaveWorld()voidLeaves the world like "Save and Quit to Title" (single player) or "Disconnect" (servers).0.1.0-alpha.4 or earlier
ClientView.openScreen(ModScreen)voidOpens screen, replacing any open screen.0.1.0-alpha.4 or earlier
ClientView.player()Optional<PlayerView>The local player, when in a world.0.1.0-alpha.4 or earlier
ClientView.postEffect()Optional<ResourceId>The active post effect, if any.0.1.0-alpha.4 or earlier
ClientView.setCameraPerspective(CameraPerspective)voidChanges the camera perspective, as F5 does.0.1.0-alpha.4 or earlier
ClientView.setPostEffect(ResourceId)booleanApplies a full-screen post effect from assets/<namespace>/post_effect/<path>.json, with its shaders, until cleared.0.1.0-alpha.4 or earlier
ClientView.showActionBar(String)voidShows a message above the hotbar (the action bar).0.1.0-alpha.4 or earlier
ClientView.world()Optional<WorldView>The client's copy of the current world, when in one.0.1.0-alpha.4 or earlier
DynamicTexture.fill(int)voidSets every pixel.0.1.0-alpha.4 or earlier
DynamicTexture.height()intHeight in pixels.0.1.0-alpha.4 or earlier
DynamicTexture.id()ResourceIdThe texture's ID, <mod id>:dynamic/<path>.0.1.0-alpha.4 or earlier
DynamicTexture.setPixel(int, int, int)voidSets one pixel, 0xAARRGGBB.0.1.0-alpha.4 or earlier
DynamicTexture.upload()voidSends the pixels to the graphics card.0.1.0-alpha.4 or earlier
DynamicTexture.width()intWidth in pixels.0.1.0-alpha.4 or earlier
FovModifier.modifyFov(float)floatReturns the field of view in degrees to use instead of fov; listeners chain.0.1.0-alpha.4 or earlier
HudCanvas.drawText(String, int, int, int)voidDraws text with a shadow.0.1.0-alpha.4 or earlier
HudCanvas.drawTexture(ResourceId, int, int, int, int)voidDraws a whole texture, such as my_mod:textures/gui/icon.png or a DynamicTexture, stretched to width × height.0.1.0-alpha.4 or earlier
HudCanvas.fill(int, int, int, int, int)voidFills the rectangle from (x1, y1) inclusive to (x2, y2) exclusive.0.1.0-alpha.4 or earlier
HudCanvas.height()intHeight of the screen in GUI pixels.0.1.0-alpha.4 or earlier
HudCanvas.textWidth(String)intWidth of text in the game font.0.1.0-alpha.4 or earlier
HudCanvas.width()intWidth of the screen in GUI pixels.0.1.0-alpha.4 or earlier
HudLayer.render(HudCanvas)voidDraws the layer.0.1.0-alpha.4 or earlier
ItemTooltipListener.onItemTooltip(ItemStackRef, TooltipLines, boolean)voidCalled on the client thread whenever the game builds an item's tooltip (every frame the tooltip is shown, and for the creative search), after the game's own lines.0.1.0-alpha.4 or earlier
KeyBinding.consumeClick()booleanReturns true once per press since the last call, so no press is lost between ticks.0.1.0-alpha.4 or earlier
KeyBinding.id()ResourceIdThe binding's ID.0.1.0-alpha.4 or earlier
KeyBinding.isDown()booleanWhether the key is held now.0.1.0-alpha.4 or earlier
ModScreen.init(ScreenBuilder)voidPlaces widgets.0.1.0-alpha.4 or earlier
ModScreen.onClosed()voidThe screen was closed, by the player (Esc) or by code.0.1.0-alpha.4 or earlier
ModScreen.pausesGame()booleanWhether the game pauses while the screen is open (single player only).0.1.0-alpha.4 or earlier
ModScreen.render(HudCanvas)voidDraws extra content every frame, above the background and below the widgets.0.1.0-alpha.4 or earlier
ModScreen.title()StringTitle used for narration and the window title.0.1.0-alpha.4 or earlier
ScreenBuilder.button(String, int, int, int, int, Runnable)voidA clickable button; onPress runs on the client thread.0.1.0-alpha.4 or earlier
ScreenBuilder.close()voidCloses this screen.0.1.0-alpha.4 or earlier
ScreenBuilder.height()intScreen height.0.1.0-alpha.4 or earlier
ScreenBuilder.label(String, int, int, int)voidText drawn every frame.0.1.0-alpha.4 or earlier
ScreenBuilder.textInput(int, int, int, String)TextInputA single-line text input, 20 pixels high.0.1.0-alpha.4 or earlier
ScreenBuilder.textWidth(String)intWidth of text in the game font.0.1.0-alpha.4 or earlier
ScreenBuilder.width()intScreen width.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.Builder.blend(ShaderPipelineDefinition.Blend)ShaderPipelineDefinition.BuilderHow colours mix; Blend.TRANSLUCENT by default.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.Builder.build()ShaderPipelineDefinitionCreates the definition.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.Builder.cull()ShaderPipelineDefinition.BuilderSkips quads facing away from the camera.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.Builder.depthWrite()ShaderPipelineDefinition.BuilderThe quads hide what is drawn behind them later, like solid geometry.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.Builder.noDepthTest()ShaderPipelineDefinition.BuilderDraws the quads in front of blocks.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.Builder.texture(ResourceId)ShaderPipelineDefinition.BuilderBinds a texture as the next sampler: the first call is Sampler0.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.Builder.uniform(String, ShaderUniform.Type, ShaderUniform.Source)ShaderPipelineDefinition.BuilderAdds a field to the pipeline's ModUniforms block, after the ones added before.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.ShaderPipelineDefinition(ResourceId, ShaderPipelineDefinition.Blend, boolean, boolean, boolean)new instanceA pipeline without textures or mod uniforms.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.ShaderPipelineDefinition(ResourceId, ShaderPipelineDefinition.Blend, boolean, boolean, boolean, List<ResourceId>, List<ShaderUniform>)new instanceValidates the definition.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.builder(ResourceId)ShaderPipelineDefinition.BuilderA translucent, double-sided pipeline that blocks hide and that hides nothing.0.1.0-alpha.4 or earlier
ShaderPipelineDefinition.textured()booleanWhether the vertices carry texture coordinates (UV0).0.1.0-alpha.4 or earlier
ShaderUniform.Source.values()float[]The value: exactly Type.components() floats.0.1.0-alpha.4 or earlier
ShaderUniform.Type.components()intHow many floats Source.values() must return.0.1.0-alpha.4 or earlier
TextInput.setValue(String)voidReplaces the text.0.1.0-alpha.4 or earlier
TextInput.value()StringThe current text.0.1.0-alpha.4 or earlier
TooltipLines.add(String)voidAdds a line at the end.0.1.0-alpha.4 or earlier
TooltipLines.add(int, String)voidInserts a line before line index; size() appends.0.1.0-alpha.4 or earlier
TooltipLines.get(int)StringThe text of line index without formatting.0.1.0-alpha.4 or earlier
TooltipLines.remove(int)voidRemoves line index.0.1.0-alpha.4 or earlier
TooltipLines.size()intNumber of lines, the name included.0.1.0-alpha.4 or earlier
VertexSink.vertex(double, double, double, float, float, int)VertexSinkAdds a vertex with a texture coordinate and a colour 0xAARRGGBB; the shader receives them as Position, UV0 and Color.0.1.0-alpha.4 or earlier
VertexSink.vertex(double, double, double, int)VertexSinkAdds a vertex with a colour 0xAARRGGBB and texture coordinate (0, 0).0.1.0-alpha.4 or earlier
WorldCanvas.animationTime()floatGame time in ticks plus the partial tick, for smooth animation.0.1.0-alpha.4 or earlier
WorldCanvas.blockOutline(BlockPos, int, float)voidThe edges of one block.0.1.0-alpha.4 or earlier
WorldCanvas.box(double, double, double, double, double, double, int, float, int)voidA box between two corners: its edges in strokeArgb (width pixels wide) and its faces filled with fillArgb; pass 0 for either to leave it out.0.1.0-alpha.4 or earlier
WorldCanvas.cameraX()doubleCamera x this frame.0.1.0-alpha.4 or earlier
WorldCanvas.cameraY()doubleCamera y this frame.0.1.0-alpha.4 or earlier
WorldCanvas.cameraZ()doubleCamera z this frame.0.1.0-alpha.4 or earlier
WorldCanvas.line(double, double, double, double, double, double, int, float)voidA line from one point to another, width pixels wide.0.1.0-alpha.4 or earlier
WorldCanvas.onTop()WorldCanvasThis canvas, drawing lines, boxes, points and text in front of blocks.0.1.0-alpha.4 or earlier
WorldCanvas.point(double, double, double, int, float)voidA square dot size pixels wide.0.1.0-alpha.4 or earlier
WorldCanvas.quads(ShaderPipeline, Consumer<VertexSink>)voidQuads drawn with a mod shader pipeline: four vertices per quad, in world coordinates.0.1.0-alpha.4 or earlier
WorldCanvas.text(String, double, double, double, int, float)voidText facing the camera, centred on the point; scale 1 is the game's label size.0.1.0-alpha.4 or earlier
WorldPainter.paint(WorldCanvas)voidDraws this frame's shapes on canvas.0.1.0-alpha.4 or earlier

command​

FunctionReturnsDescriptionSince
ArgumentCommand.type()CommandArgumentTypeWhat the argument accepts.0.1.0-alpha.4 or earlier
CommandAction.run(CommandContext)intRuns the command.0.1.0-alpha.4 or earlier
CommandArgumentType.blockPos()CommandArgumentTypeBlock coordinates.0.1.0-alpha.4 or earlier
CommandArgumentType.bool()CommandArgumentTypetrue or false.0.1.0-alpha.4 or earlier
CommandArgumentType.decimal()CommandArgumentTypeAny decimal number.0.1.0-alpha.4 or earlier
CommandArgumentType.greedyString()CommandArgumentTypeThe rest of the command line.0.1.0-alpha.4 or earlier
CommandArgumentType.integer()CommandArgumentTypeAny whole number.0.1.0-alpha.4 or earlier
CommandArgumentType.integer(int, int)CommandArgumentTypeA whole number in [min, max].0.1.0-alpha.4 or earlier
CommandArgumentType.player()CommandArgumentTypeOne online player.0.1.0-alpha.4 or earlier
CommandArgumentType.string()CommandArgumentTypeA word or quoted text.0.1.0-alpha.4 or earlier
CommandArgumentType.word()CommandArgumentTypeA single word.0.1.0-alpha.4 or earlier
CommandContext.getBlockPos(String)BlockPosValue of a CommandArgumentType.blockPos() argument, resolved against the source.0.1.0-alpha.4 or earlier
CommandContext.getBoolean(String)booleanValue of a CommandArgumentType.bool() argument.0.1.0-alpha.4 or earlier
CommandContext.getDouble(String)doubleValue of a CommandArgumentType.decimal() argument.0.1.0-alpha.4 or earlier
CommandContext.getInteger(String)intValue of an CommandArgumentType.integer() argument.0.1.0-alpha.4 or earlier
CommandContext.getPlayer(String)PlayerViewValue of a CommandArgumentType.player() argument.0.1.0-alpha.4 or earlier
CommandContext.getString(String)StringValue of a text argument.0.1.0-alpha.4 or earlier
CommandContext.source()CommandSourceWho ran the command.0.1.0-alpha.4 or earlier
CommandFailure.CommandFailure(String)new instanceCreates a failure with the message shown to the user.0.1.0-alpha.4 or earlier
CommandNode.action()Optional<CommandAction>The action run when the command ends here.0.1.0-alpha.4 or earlier
CommandNode.argument(String, CommandArgumentType)ArgumentCommandA typed value; read it in actions with context.get*(name).0.1.0-alpha.4 or earlier
CommandNode.children()List<CommandNode<?>>Child nodes in registration order.0.1.0-alpha.4 or earlier
CommandNode.executes(CommandAction)NLets the command end at this node and run action.0.1.0-alpha.4 or earlier
CommandNode.literal(String)LiteralCommandA fixed word, for example /hello.0.1.0-alpha.4 or earlier
CommandNode.name()StringThe word or argument name.0.1.0-alpha.4 or earlier
CommandNode.permissionLevel()intRequired permission level, 0–4.0.1.0-alpha.4 or earlier
CommandNode.permissionNode()Optional<PermissionNode>The required named permission, if any (checked in addition to the level).0.1.0-alpha.4 or earlier
CommandNode.requiresPermission(PermissionNode)NOnly sources that have node can see and run this node.0.1.0-alpha.4 or earlier
CommandNode.requiresPermission(int)NOnly sources with at least this permission level can see and run this node: 0 everyone, 2 game masters (command blocks, operators), 4 server owners.0.1.0-alpha.4 or earlier
CommandNode.then(CommandNode<?>)NAdds a child that may follow this node.0.1.0-alpha.4 or earlier
CommandRegistrar.register(LiteralCommand)voidRegisters a top-level command.0.1.0-alpha.4 or earlier
CommandSource.blockPos()BlockPosThe block position the command runs at.0.1.0-alpha.4 or earlier
CommandSource.hasPermission(PermissionNode)booleanWhether the source has the permission: for players as PlayerView.hasPermission; for the console, command blocks, and functions by the node's default level.0.1.0-alpha.4 or earlier
CommandSource.hasPermission(int)booleanWhether the source has at least permission level (0–4).0.1.0-alpha.4 or earlier
CommandSource.name()StringDisplay name, for example a player name or Server.0.1.0-alpha.4 or earlier
CommandSource.player()Optional<PlayerView>The player who ran the command, if a player did.0.1.0-alpha.4 or earlier
CommandSource.sendFailure(String)voidSends an error message (shown in red to players).0.1.0-alpha.4 or earlier
CommandSource.sendMessage(String)voidSends feedback text to the source.0.1.0-alpha.4 or earlier
CommandSource.world()WorldViewThe world the command runs in.0.1.0-alpha.4 or earlier

content​

FunctionReturnsDescriptionSince
AdvancementTrigger.id()ResourceIdThe trigger ID used in advancement files.0.1.0-alpha.4 or earlier
AdvancementTrigger.trigger(PlayerView)voidMeets every criterion with this trigger for player.0.1.0-alpha.4 or earlier
ContentHandle.id()ResourceIdThe content's ID, <mod id>:<path>.0.1.0-alpha.4 or earlier
ContentHandle.isRegistered()booleanWhether the game has created and registered the content yet.0.1.0-alpha.4 or earlier
ContentRegistrar.addToTag(TagKey, ResourceId[])voidAdds entries to a tag of any namespace, as a tag file with "replace": false in the mod jar would; Poly Mod Loader writes them to its generated data pack.0.1.0-alpha.4 or earlier
ContentRegistrar.advancementTrigger(String)AdvancementTriggerDeclares an advancement criterion trigger <mod id>:<path>.0.1.0-alpha.4 or earlier
ContentRegistrar.block(String, BlockDefinition)BlockHandleDeclares a block; unless the definition says otherwise, a block item with the same ID is declared too.0.1.0-alpha.4 or earlier
ContentRegistrar.booleanRule(String, boolean, GameRuleCategory)GameRuleKey<Boolean>Declares a boolean game rule.0.1.0-alpha.4 or earlier
ContentRegistrar.creativeTab(String, CreativeTabDefinition)ContentHandleDeclares a creative inventory tab <mod id>:<path>, titled by the translation of itemGroup.<mod id>.<path>.0.1.0-alpha.4 or earlier
ContentRegistrar.effect(String, EffectDefinition)EffectHandleDeclares a status effect usable with /effect and LivingEntityView.addEffect.0.1.0-alpha.4 or earlier
ContentRegistrar.entity(String, EntityDefinition)EntityHandleDeclares a mob type; with spawnEgg also an item <path>_spawn_egg.0.1.0-alpha.4 or earlier
ContentRegistrar.entityData(String, EntityDataOptions)EntityDataKeyDeclares data that entities carry, with synchronisation and version options.0.1.0-alpha.4 or earlier
ContentRegistrar.entityData(String, boolean)EntityDataKeyDeclares data that entities carry; see EntityDataKey.0.1.0-alpha.4 or earlier
ContentRegistrar.integerRule(String, int, int, int, GameRuleCategory)GameRuleKey<Integer>Declares an integer game rule limited to [min, max].0.1.0-alpha.4 or earlier
ContentRegistrar.item(String, ItemDefinition)ItemHandleDeclares an item.0.1.0-alpha.4 or earlier
ContentRegistrar.itemComponent(String, ComponentType<T>)ItemComponentKey<T>Declares a data component that item stacks can carry.0.1.0-alpha.4 or earlier
ContentRegistrar.particle(String, ParticleDefinition)ContentHandleDeclares a particle type, spawnable with WorldView.spawnParticles and /particle.0.1.0-alpha.4 or earlier
ContentRegistrar.projectile(String, ProjectileDefinition)EntityHandleDeclares a thrown projectile type.0.1.0-alpha.4 or earlier
ContentRegistrar.sound(String)SoundHandleDeclares a sound event.0.1.0-alpha.4 or earlier
CreativeTabDefinition.Builder.build()CreativeTabDefinitionBuilds the definition.0.1.0-alpha.4 or earlier
CreativeTabDefinition.Builder.entries(ResourceId[])CreativeTabDefinition.BuilderAdds items to the end of the tab, in order.0.1.0-alpha.4 or earlier
CreativeTabDefinition.Builder.entry(ResourceId)CreativeTabDefinition.BuilderAdds an item to the end of the tab.0.1.0-alpha.4 or earlier
CreativeTabDefinition.Builder.icon(ResourceId)CreativeTabDefinition.BuilderSets the item shown on the tab.0.1.0-alpha.4 or earlier
CreativeTabDefinition.builder()CreativeTabDefinition.BuilderA builder for a tab without entries yet.0.1.0-alpha.4 or earlier
CreativeTabDefinition.iconOrFirstEntry()ResourceIdThe icon: the declared one or the first entry.0.1.0-alpha.4 or earlier
EntityDataKey.syncToOwner()booleanWhether a player's own client receives the player's data.0.1.0-alpha.4 or earlier
EntityDataOptions.syncedToOwner()EntityDataOptionsA copy whose data a player's own client receives.0.1.0-alpha.4 or earlier
EntityDataOptions.syncedToTrackers()EntityDataOptionsA copy whose data every client that can see the entity receives.0.1.0-alpha.4 or earlier
EntityDataOptions.withVersion(int, DataMigration)EntityDataOptionsA copy with data version value; upgrade converts data saved with an older version.0.1.0-alpha.4 or earlier

content.block​

FunctionReturnsDescriptionSince
BlockBehavior.onNeighborChanged(WorldView, BlockPos)voidA neighbouring block changed (server and client); typical for redstone-like reactions.0.1.0-alpha.4 or earlier
BlockBehavior.onPlaced(WorldView, BlockPos, EntityView)voidThe block was placed by an entity (server and client).0.1.0-alpha.4 or earlier
BlockBehavior.onRandomTick(WorldView, BlockPos)voidA random tick reached the block (server only, about every 68 seconds per block at the default randomTickSpeed).0.1.0-alpha.4 or earlier
BlockBehavior.onSteppedOn(WorldView, BlockPos, EntityView)voidAn entity walks on top of the block.0.1.0-alpha.4 or earlier
BlockBehavior.onUse(BlockUse)InteractionResultA player used the block with an empty hand.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.behavior(BlockBehavior)BlockDefinition.BuilderSets the interaction callbacks.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.blockEntity(BlockEntityDefinition)BlockDefinition.BuilderGives the block per-position saved state.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.build()BlockDefinitionCreates the definition; invalid values throw IllegalArgumentException.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.collisionShape(BlockShape)BlockDefinition.BuilderWhat entities collide with, when it differs from shape: a low fence-like box, for example.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.collisionShape(Function<BlockStateView,BlockShape>)BlockDefinition.BuilderWhat entities collide with, computed from the state.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.facesPlayerWhenPlaced(BlockProperty.DirectionProperty)BlockDefinition.BuilderAdds facing as a property and sets it on placement so the block faces the player.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.friction(float)BlockDefinition.BuilderSets the friction (0.6 default, 0.98 ice).0.1.0-alpha.4 or earlier
BlockDefinition.Builder.item(ItemDefinition)BlockDefinition.BuilderSets the properties of the block item declared with the block.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.lightLevel(ToIntFunction<BlockStateView>)BlockDefinition.BuilderComputes the emitted light from each state, for example state -> state.get(LIT) ? 15 : 0.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.lightLevel(int)BlockDefinition.BuilderSets the emitted light level, 0–15.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.noCollision()BlockDefinition.BuilderEntities pass through the block.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.noItem()BlockDefinition.BuilderDeclares no block item.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.noOcclusion()BlockDefinition.BuilderThe block does not hide its neighbours' faces (glass-like blocks).0.1.0-alpha.4 or earlier
BlockDefinition.Builder.properties(BlockProperty<?>[])BlockDefinition.BuilderAdds block state properties; their default values form the default state.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.randomTicks()BlockDefinition.BuilderThe block receives random ticks.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.requiresCorrectTool()BlockDefinition.BuilderThe block drops only when mined with the correct tool.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.shape(BlockShape)BlockDefinition.BuilderThe block's outline and collision: a slab, a post, a pipe.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.shape(Function<BlockStateView,BlockShape>)BlockDefinition.BuilderThe block's outline and collision computed from the state, for example turned with BlockShape.facing by a facing property.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.sound(BlockSound)BlockDefinition.BuilderSets the sound type.0.1.0-alpha.4 or earlier
BlockDefinition.Builder.strength(float, float)BlockDefinition.BuilderSets hardness and explosion resistance (stone is 1.5 / 6.0).0.1.0-alpha.4 or earlier
BlockDefinition.builder()BlockDefinition.BuilderA builder with the game's defaults for a plain stone-like block that has a block item.0.1.0-alpha.4 or earlier
BlockShape.box(double, double, double, double, double, double)BlockShapeOne box, in pixels.0.1.0-alpha.4 or earlier
BlockShape.facing(Direction)BlockShapeThis shape, drawn facing north, turned around the block's vertical axis to face facing.0.1.0-alpha.4 or earlier
BlockShape.or(BlockShape)BlockShapeThis shape together with other.0.1.0-alpha.4 or earlier

content.block.entity​

FunctionReturnsDescriptionSince
BlockEntityDefinition.Builder.build()BlockEntityDefinitionCreates the definition.0.1.0-alpha.4 or earlier
BlockEntityDefinition.Builder.dataVersion(int, DataMigration)BlockEntityDefinition.BuilderSets the data version; block entities saved with an older one run upgrade on load.0.1.0-alpha.4 or earlier
BlockEntityDefinition.Builder.inventory(int, String)BlockEntityDefinition.BuilderAdds an inventory of rows × 9 slots with a menu titled title.0.1.0-alpha.4 or earlier
BlockEntityDefinition.Builder.menu(MenuLayout, String)BlockEntityDefinition.BuilderAdds an inventory with one slot per layout slot, shown in a menu with that layout.0.1.0-alpha.4 or earlier
BlockEntityDefinition.Builder.syncToClients()BlockEntityDefinition.BuilderSends data changes to clients when BlockEntityView.markChanged() is called.0.1.0-alpha.4 or earlier
BlockEntityDefinition.Builder.ticker(BlockEntityTicker)BlockEntityDefinition.BuilderRuns ticker on the server every tick.0.1.0-alpha.4 or earlier
BlockEntityDefinition.builder()BlockEntityDefinition.BuilderA builder for a block entity with data only.0.1.0-alpha.4 or earlier
BlockEntityDefinition.inventorySize()intNumber of inventory slots: from the layout, or rows × 9.0.1.0-alpha.4 or earlier
BlockEntityTicker.tick(BlockEntityView)voidCalled on the server thread; entity is valid only during the call.0.1.0-alpha.4 or earlier
BlockEntityView.data()DataTreeIts saved data; call markChanged() after changing it.0.1.0-alpha.4 or earlier
BlockEntityView.inventory()Optional<InventoryView>Its inventory, when the definition has one.0.1.0-alpha.4 or earlier
BlockEntityView.markChanged()voidMarks the data for saving and, for synchronised block entities, sends it to clients.0.1.0-alpha.4 or earlier
BlockEntityView.pos()BlockPosIts position.0.1.0-alpha.4 or earlier
BlockEntityView.world()WorldViewThe world it is in.0.1.0-alpha.4 or earlier
MenuLayout.Builder.background(ResourceId)MenuLayout.BuilderDraws texture instead of the plain panel.0.1.0-alpha.4 or earlier
MenuLayout.Builder.build()MenuLayoutCreates the layout; invalid values throw IllegalArgumentException.0.1.0-alpha.4 or earlier
MenuLayout.Builder.grid(int, int, int, int)MenuLayout.BuilderAdds a columns × rows grid of slots with 18-pixel spacing.0.1.0-alpha.4 or earlier
MenuLayout.Builder.outputSlot(int, int)MenuLayout.BuilderAdds a slot players can only take from.0.1.0-alpha.4 or earlier
MenuLayout.Builder.playerInventory(int, int)MenuLayout.BuilderMoves the player's inventory (default 8, height - 82).0.1.0-alpha.4 or earlier
MenuLayout.Builder.progressBar(int, int, MenuLayout.ProgressStyle, String, String)MenuLayout.BuilderAdds a progress bar.0.1.0-alpha.4 or earlier
MenuLayout.Builder.slot(int, int)MenuLayout.BuilderAdds a slot.0.1.0-alpha.4 or earlier
MenuLayout.builder(int, int)MenuLayout.BuilderA builder for a width × height menu with the inventory at the game's usual place.0.1.0-alpha.4 or earlier

content.block.state​

FunctionReturnsDescriptionSince
BlockProperty.BooleanProperty.defaultValue()BooleanValue of the block's default state.0.1.0-alpha.4 or earlier
BlockProperty.BooleanProperty.name()StringProperty name used in blockstate files and commands.0.1.0-alpha.4 or earlier
BlockProperty.BooleanProperty.values()List<Boolean>Every allowed value, in the game's order.0.1.0-alpha.4 or earlier
BlockProperty.BooleanProperty.withDefault(boolean)BlockProperty.BooleanPropertyThe same property with another default.0.1.0-alpha.4 or earlier
BlockProperty.ChoiceProperty.defaultValue()StringValue of the block's default state.0.1.0-alpha.4 or earlier
BlockProperty.ChoiceProperty.name()StringProperty name used in blockstate files and commands.0.1.0-alpha.4 or earlier
BlockProperty.ChoiceProperty.values()List<String>Every allowed value, in the game's order.0.1.0-alpha.4 or earlier
BlockProperty.ChoiceProperty.withDefault(String)BlockProperty.ChoicePropertyThe same property with another default.0.1.0-alpha.4 or earlier
BlockProperty.DirectionProperty.defaultValue()DirectionValue of the block's default state.0.1.0-alpha.4 or earlier
BlockProperty.DirectionProperty.name()StringProperty name used in blockstate files and commands.0.1.0-alpha.4 or earlier
BlockProperty.DirectionProperty.values()List<Direction>Every allowed value, in the game's order.0.1.0-alpha.4 or earlier
BlockProperty.DirectionProperty.withDefault(Direction)BlockProperty.DirectionPropertyThe same property with another default.0.1.0-alpha.4 or earlier
BlockProperty.IntegerProperty.defaultValue()IntegerValue of the block's default state.0.1.0-alpha.4 or earlier
BlockProperty.IntegerProperty.name()StringProperty name used in blockstate files and commands.0.1.0-alpha.4 or earlier
BlockProperty.IntegerProperty.values()List<Integer>Every allowed value, in the game's order.0.1.0-alpha.4 or earlier
BlockProperty.IntegerProperty.withDefault(int)BlockProperty.IntegerPropertyThe same property with another default.0.1.0-alpha.4 or earlier
BlockProperty.bool(String)BlockProperty.BooleanPropertyA true/false property, default false.0.1.0-alpha.4 or earlier
BlockProperty.choice(String, String[])BlockProperty.ChoicePropertyA property with named values, in this order; the first is the default.0.1.0-alpha.4 or earlier
BlockProperty.defaultValue()TValue of the block's default state.0.1.0-alpha.4 or earlier
BlockProperty.direction(String)BlockProperty.DirectionPropertyAny of the six directions, default north.0.1.0-alpha.4 or earlier
BlockProperty.horizontalFacing(String)BlockProperty.DirectionPropertyA horizontal facing (north, south, west, east), default north.0.1.0-alpha.4 or earlier
BlockProperty.integer(String, int, int)BlockProperty.IntegerPropertyA whole-number property in [min, max] with 0 <= min < max <= min + 255, default min.0.1.0-alpha.4 or earlier
BlockProperty.name()StringProperty name used in blockstate files and commands.0.1.0-alpha.4 or earlier
BlockProperty.values()List<T>Every allowed value, in the game's order.0.1.0-alpha.4 or earlier
BlockStateView.block()ResourceIdThe block, for example minecraft:furnace.0.1.0-alpha.4 or earlier
BlockStateView.find(BlockProperty<T>)Optional<T>The property's value, or empty when the block has no such property.0.1.0-alpha.4 or earlier
BlockStateView.get(BlockProperty<T>)TThe property's value.0.1.0-alpha.4 or earlier
BlockStateView.has(BlockProperty<?>)booleanWhether the block has a property with this name and value type.0.1.0-alpha.4 or earlier
BlockStateView.with(BlockProperty<T>, T)BlockStateViewThis state with one property changed; this snapshot stays as it is.0.1.0-alpha.4 or earlier

content.effect​

FunctionReturnsDescriptionSince
EffectBehavior.onTick(LivingEntityView, int)voidCalled on the server every tickInterval ticks while the entity has the effect.0.1.0-alpha.4 or earlier

content.entity​

FunctionReturnsDescriptionSince
AiGoal.canStart(MobView)booleanWhether the goal should start now.0.1.0-alpha.4 or earlier
AiGoal.controls()Set<GoalControl>The controls this goal needs while it runs; default GoalControl.MOVE.0.1.0-alpha.4 or earlier
AiGoal.shouldContinue(MobView)booleanWhether a running goal keeps running; default canStart.0.1.0-alpha.4 or earlier
AiGoal.start(MobView)voidThe goal started.0.1.0-alpha.4 or earlier
AiGoal.stop(MobView)voidThe goal stopped or was interrupted.0.1.0-alpha.4 or earlier
AiGoal.tick(MobView)voidEvery tick while running.0.1.0-alpha.4 or earlier
EntityBehavior.onInteract(EntityInteraction)InteractionResultA player used the mob (both sides; check world().isClientSide()).0.1.0-alpha.4 or earlier
EntityBehavior.onServerTick(LivingEntityView)voidEvery server tick while the mob is alive.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.attackPlayers(double)EntityDefinition.BuilderThe mob chases and hits players for damage.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.behavior(EntityBehavior)EntityDefinition.BuilderCallbacks for ticks and interaction.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.build()EntityDefinitionCreates the definition; invalid values throw IllegalArgumentException.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.category(MobCategory)EntityDefinition.BuilderSpawn group; MobCategory.CREATURE by default.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.flying(double)EntityDefinition.BuilderThe mob flies and hovers (Movement.FLY) at flyingSpeed (parrot 0.4) in the air; movementSpeed still applies on the ground.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.goal(int, Supplier<AiGoal>)EntityDefinition.BuilderAdds an AI goal created for each mob by factory.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.maxHealth(double)EntityDefinition.BuilderHealth in half-hearts; 20 by default.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.model(EntityModelDefinition)EntityDefinition.BuilderDraws the mob with a box model instead of the player-shaped one.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.movementSpeed(double)EntityDefinition.BuilderBase speed (zombie 0.23, villager 0.5); 0.25 by default.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.noGravity()EntityDefinition.BuilderThe mob is not pulled down by gravity.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.noWandering()EntityDefinition.BuilderThe mob stands still.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.notPushable()EntityDefinition.BuilderOther entities do not push the mob.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.panicWhenHurt()EntityDefinition.BuilderThe mob runs away for a while after being hurt.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.rideable(boolean)EntityDefinition.BuilderPlayers can ride the mob; with steerable they also steer it.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.size(float, float)EntityDefinition.BuilderHitbox width and height in blocks.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.spawnEgg(CreativeTab)EntityDefinition.BuilderDeclares a spawn egg item <id>_spawn_egg listed in tab.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.spawnsNaturally(BiomeSelector, int, int, int)EntityDefinition.BuilderThe mob spawns by itself in biomes, in groups of minGroup..maxGroup.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.swimming()EntityDefinition.BuilderThe mob swims under water (Movement.SWIM) at movementSpeed.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.targetGoal(int, Supplier<AiGoal>)EntityDefinition.BuilderAdds a target goal (chooses whom to attack) created for each mob by factory.0.1.0-alpha.4 or earlier
EntityDefinition.Builder.temptedBy(ResourceId)EntityDefinition.BuilderThe mob follows players holding item.0.1.0-alpha.4 or earlier
EntityDefinition.builder(ResourceId)EntityDefinition.BuilderA builder for a 0.6×1.95 creature (player-sized) with the given skin texture.0.1.0-alpha.4 or earlier
ProjectileBehavior.onHitBlock(ProjectileHit)voidThe projectile hit a block.0.1.0-alpha.4 or earlier
ProjectileBehavior.onHitEntity(ProjectileHit)voidThe projectile hit an entity, after its damage was dealt.0.1.0-alpha.4 or earlier
ProjectileDefinition.Builder.behavior(ProjectileBehavior)ProjectileDefinition.BuilderCallbacks for hitting blocks and entities.0.1.0-alpha.4 or earlier
ProjectileDefinition.Builder.build()ProjectileDefinitionCreates the definition; invalid values throw IllegalArgumentException.0.1.0-alpha.4 or earlier
ProjectileDefinition.Builder.damage(float)ProjectileDefinition.BuilderDamage to a hit entity, 0 for none.0.1.0-alpha.4 or earlier
ProjectileDefinition.Builder.gravity(double)ProjectileDefinition.BuilderDownward acceleration per tick (snowball 0.03).0.1.0-alpha.4 or earlier
ProjectileDefinition.Builder.size(float)ProjectileDefinition.BuilderHitbox width and height in blocks.0.1.0-alpha.4 or earlier
ProjectileDefinition.builder(ResourceId)ProjectileDefinition.BuilderA builder for a 0.25-block projectile drawn as item, with snowball gravity and no damage.0.1.0-alpha.4 or earlier

content.entity.model​

FunctionReturnsDescriptionSince
EntityModelDefinition.Builder.animation(String, KeyframeAnimation)EntityModelDefinition.BuilderAdds a keyframe animation called name; KeyframeAnimation.Trigger.ON_DEMAND ones are started by name with MobView.playAnimation.0.1.0-alpha.4 or earlier
EntityModelDefinition.Builder.build()EntityModelDefinitionCreates the model; invalid parts throw IllegalArgumentException.0.1.0-alpha.4 or earlier
EntityModelDefinition.Builder.part(String, Consumer<ModelPartDefinition.Builder>)EntityModelDefinition.BuilderAdds a part configured by part.0.1.0-alpha.4 or earlier
EntityModelDefinition.builder(int, int)EntityModelDefinition.BuilderA builder for a model using a textureWidth × textureHeight texture.0.1.0-alpha.4 or earlier
EntityModelDefinition.onDemandAnimations()List<String>Names of the KeyframeAnimation.Trigger.ON_DEMAND animations, in declaration order.0.1.0-alpha.4 or earlier
KeyframeAnimation.Builder.build()KeyframeAnimationCreates the animation; invalid values throw IllegalArgumentException.0.1.0-alpha.4 or earlier
KeyframeAnimation.Builder.keyframe(String, KeyframeAnimation.Target, float, float, float, float, KeyframeAnimation.Interpolation)KeyframeAnimation.BuilderAdds a keyframe with every detail given.0.1.0-alpha.4 or earlier
KeyframeAnimation.Builder.looping()KeyframeAnimation.BuilderStarts over at the end.0.1.0-alpha.4 or earlier
KeyframeAnimation.Builder.position(String, float, float, float, float)KeyframeAnimation.BuilderMoves part by x, y, z model pixels (y up) at time seconds.0.1.0-alpha.4 or earlier
KeyframeAnimation.Builder.rotation(String, float, float, float, float)KeyframeAnimation.BuilderRotates part by x, y, z degrees at time seconds.0.1.0-alpha.4 or earlier
KeyframeAnimation.Builder.scale(String, float, float, float, float)KeyframeAnimation.BuilderScales part by x, y, z (1 keeps the size) at time seconds.0.1.0-alpha.4 or earlier
KeyframeAnimation.Builder.smooth()KeyframeAnimation.BuilderBlends the keyframes added after this call along smooth curves instead of straight lines.0.1.0-alpha.4 or earlier
KeyframeAnimation.Builder.trigger(KeyframeAnimation.Trigger)KeyframeAnimation.BuilderWhen the animation plays; Trigger.ON_DEMAND by default.0.1.0-alpha.4 or earlier
KeyframeAnimation.builder(float)KeyframeAnimation.BuilderA builder for an animation lengthSeconds long that plays when the server starts it.0.1.0-alpha.4 or earlier
ModelPartDefinition.Builder.animation(PartAnimation)ModelPartDefinition.BuilderHow the part moves on its own; PartAnimation.NONE by default.0.1.0-alpha.4 or earlier
ModelPartDefinition.Builder.box(int, int, float, float, float, float, float, float)ModelPartDefinition.BuilderAdds a box whose texture net starts at u, v.0.1.0-alpha.4 or earlier
ModelPartDefinition.Builder.mirroredBox(int, int, float, float, float, float, float, float)ModelPartDefinition.BuilderAdds a box with a mirrored texture.0.1.0-alpha.4 or earlier
ModelPartDefinition.Builder.parent(String)ModelPartDefinition.BuilderAttaches the part to parent; its pivot becomes relative to the parent's.0.1.0-alpha.4 or earlier
ModelPartDefinition.Builder.pivot(float, float, float)ModelPartDefinition.BuilderThe point the part turns around, relative to the parent's pivot (model pixels, y down).0.1.0-alpha.4 or earlier
ModelPartDefinition.Builder.rotation(float, float, float)ModelPartDefinition.BuilderRest rotation in degrees.0.1.0-alpha.4 or earlier

content.item​

FunctionReturnsDescriptionSince
ComponentType.valueClass()Class<T>Java type of the value.0.1.0-alpha.4 or earlier
ItemBehavior.onUse(ItemUse)InteractionResultThe item was used in the air.0.1.0-alpha.4 or earlier
ItemDefinition.Builder.behavior(ItemBehavior)ItemDefinition.BuilderSets the use callbacks.0.1.0-alpha.4 or earlier
ItemDefinition.Builder.build()ItemDefinitionCreates the definition; invalid values throw IllegalArgumentException.0.1.0-alpha.4 or earlier
ItemDefinition.Builder.creativeTab(CreativeTab)ItemDefinition.BuilderLists the item at the end of a creative inventory tab.0.1.0-alpha.4 or earlier
ItemDefinition.Builder.durability(int)ItemDefinition.BuilderGives the item durability; also sets the stack size to 1.0.1.0-alpha.4 or earlier
ItemDefinition.Builder.fireResistant()ItemDefinition.BuilderThe dropped item survives fire and lava.0.1.0-alpha.4 or earlier
ItemDefinition.Builder.food(FoodDefinition)ItemDefinition.BuilderMakes the item edible.0.1.0-alpha.4 or earlier
ItemDefinition.Builder.maxStackSize(int)ItemDefinition.BuilderSets the maximum stack size, 1–99.0.1.0-alpha.4 or earlier
ItemDefinition.Builder.rarity(ItemRarity)ItemDefinition.BuilderSets the name colour.0.1.0-alpha.4 or earlier
ItemDefinition.builder()ItemDefinition.BuilderA builder for a common item stacking to 64, listed in no tab.0.1.0-alpha.4 or earlier

content.particle​

FunctionReturnsDescriptionSince
ParticleDefinition.asGlowing()ParticleDefinitionA copy drawn at full brightness, also in the dark.0.1.0-alpha.4 or earlier
ParticleDefinition.of(int)ParticleDefinitionLives lifetimeTicks, no gravity, default size, normal lighting, no tint.0.1.0-alpha.4 or earlier
ParticleDefinition.withGravity(float)ParticleDefinitionA copy with this downward acceleration (0 floats).0.1.0-alpha.4 or earlier
ParticleDefinition.withScale(float)ParticleDefinitionA copy with this size multiplier.0.1.0-alpha.4 or earlier
ParticleDefinition.withTint(int)ParticleDefinitionA copy with this colour, 0xRRGGBB, multiplied into the sprite.0.1.0-alpha.4 or earlier

data​

FunctionReturnsDescriptionSince
DataMigration.migrate(DataTree, int)voidUpgrades data from fromVersion to the current version.0.1.0-alpha.4 or earlier
DataTree.child(String)DataTreeThe child tree under key, creating it (and replacing a non-tree value) if needed.0.1.0-alpha.4 or earlier
DataTree.clear()voidRemoves every entry.0.1.0-alpha.4 or earlier
DataTree.copy()DataTreeA deep copy.0.1.0-alpha.4 or earlier
DataTree.create()DataTreeAn empty tree.0.1.0-alpha.4 or earlier
DataTree.findChild(String)Optional<DataTree>The child tree under key, without creating it.0.1.0-alpha.4 or earlier
DataTree.getBoolean(String, boolean)booleanThe boolean under key, or fallback if there is none.0.1.0-alpha.4 or earlier
DataTree.getBytes(String)Optional<byte[]>A copy of the stored bytes.0.1.0-alpha.4 or earlier
DataTree.getDouble(String, double)doubleThe double under key, or fallback if there is none.0.1.0-alpha.4 or earlier
DataTree.getInt(String, int)intThe integer under key, or fallback if there is none.0.1.0-alpha.4 or earlier
DataTree.getLong(String, long)longThe long under key, or fallback if there is none.0.1.0-alpha.4 or earlier
DataTree.getString(String, String)StringThe string under key, or fallback if there is none.0.1.0-alpha.4 or earlier
DataTree.has(String)booleanWhether any value is stored under key.0.1.0-alpha.4 or earlier
DataTree.keys()Set<String>Keys in insertion order.0.1.0-alpha.4 or earlier
DataTree.putBoolean(String, boolean)DataTreeStores a boolean under key; returns this tree.0.1.0-alpha.4 or earlier
DataTree.putBytes(String, byte[])DataTreeStores a copy of value under key; returns this tree.0.1.0-alpha.4 or earlier
DataTree.putDouble(String, double)DataTreeStores a double under key; returns this tree.0.1.0-alpha.4 or earlier
DataTree.putInt(String, int)DataTreeStores an integer under key; returns this tree.0.1.0-alpha.4 or earlier
DataTree.putLong(String, long)DataTreeStores a long under key; returns this tree.0.1.0-alpha.4 or earlier
DataTree.putString(String, String)DataTreeStores a string under key; returns this tree.0.1.0-alpha.4 or earlier
DataTree.raw(String)Optional<Object>The raw value under key: Integer, Long, Double, Boolean, String, byte[] (shared, do not modify), or DataTree; empty when absent.0.1.0-alpha.4 or earlier
DataTree.remove(String)voidRemoves the value under key, if any.0.1.0-alpha.4 or earlier

devtools.gametest​

FunctionReturnsDescriptionSince
GameTest.run(GameTestContext)voidStarts the test on the server thread.0.1.0-alpha.4 or earlier
GameTestContext.absolute(BlockPos)BlockPosConverts a test-relative position into a world position.0.1.0-alpha.4 or earlier
GameTestContext.assertBlock(BlockPos, ResourceId)voidFails unless the block at a test-relative position is expected.0.1.0-alpha.4 or earlier
GameTestContext.assertTrue(boolean, String)voidFails with message unless condition holds.0.1.0-alpha.4 or earlier
GameTestContext.attackEntity(PlayerView, EntityView)voidMakes a server player attack target with its main hand, as a left-click does (interaction events, then damage and knockback).0.1.0-alpha.4 or earlier
GameTestContext.breakBlock(PlayerView, BlockPos)booleanMakes a server player break the block at a test-relative position at once, the way the server finishes a player's digging: block events, the game's checks, drops in survival mode.0.1.0-alpha.4 or earlier
GameTestContext.createConnectedMockPlayer()PlayerViewCreates a survival-mode player that joins the server like a client over an in-memory connection (PlayerEvents.JOINED fires) and reports that it finished loading, so it can take damage.0.1.0-alpha.4 or earlier
GameTestContext.createMockPlayer()PlayerViewCreates a survival-mode player in the test world that is not connected to any client.0.1.0-alpha.4 or earlier
GameTestContext.createMockServerPlayer()PlayerViewCreates a survival-mode server player that is not connected and not in the world, for what needs one, such as advancements.0.1.0-alpha.4 or earlier
GameTestContext.disconnect(PlayerView)voidDisconnects a player from createConnectedMockPlayer() (PlayerEvents.LEAVING fires); does nothing for a player that already left.0.1.0-alpha.4 or earlier
GameTestContext.fail(String)voidMarks the test failed.0.1.0-alpha.4 or earlier
GameTestContext.interactBlock(PlayerView, BlockPos, Direction)InteractionResultMakes a server player (from createMockServerPlayer()) right-click a face of the block at a test-relative position with its main hand, the way the server handles the click from a connected client: interaction events first, then the held item and the block.0.1.0-alpha.4 or earlier
GameTestContext.interactEntity(PlayerView, EntityView)InteractionResultMakes a server player right-click target with its main hand, the way the server handles the click from a connected client (interaction events, then the entity and the item).0.1.0-alpha.4 or earlier
GameTestContext.interactItem(PlayerView)InteractionResultMakes a server player use the item in its main hand in the air, the way the server handles the click from a connected client (interaction events, then the item).0.1.0-alpha.4 or earlier
GameTestContext.respawn(PlayerView, boolean)PlayerViewRespawns a player from createConnectedMockPlayer() as its client asks from the death screen (or after the End credits): the game builds a new player object, PlayerEvents.COPY and RESPAWNED fire, and the new player reports that it loaded.0.1.0-alpha.4 or earlier
GameTestContext.runAfter(int, Runnable)voidRuns action after ticks more ticks, on the server thread.0.1.0-alpha.4 or earlier
GameTestContext.runCommand(String)intRuns a command as the server at the test area's origin.0.1.0-alpha.4 or earlier
GameTestContext.setBlock(BlockPos, ResourceId)voidPlaces the default state of block at a test-relative position.0.1.0-alpha.4 or earlier
GameTestContext.succeed()voidMarks the test passed.0.1.0-alpha.4 or earlier
GameTestContext.useBlock(BlockPos, PlayerView)voidMakes player use (right-click) the block at a test-relative position with an empty hand.0.1.0-alpha.4 or earlier
GameTestContext.world()WorldViewThe world the test runs in.0.1.0-alpha.4 or earlier
GameTestRegistrar.register(String, GameTest)voidRegisters a required test that must finish within 100 ticks.0.1.0-alpha.4 or earlier
GameTestRegistrar.register(String, int, GameTest)voidRegisters a required test.0.1.0-alpha.4 or earlier
GameTestRegistrar.register(String, int, TestArea, GameTest)voidRegisters a required test that gets area to itself.0.1.0-alpha.4 or earlier
TestArea.cube(int)TestAreaA size × size × size cube.0.1.0-alpha.4 or earlier

entity​

FunctionReturnsDescriptionSince
EntityView.blockPos()BlockPosThe block the entity stands in.0.1.0-alpha.4 or earlier
EntityView.changeDimension(ResourceId, double, double, double)EntityViewMoves the entity to another dimension, for example minecraft:the_nether or a mod dimension from data; server side only.0.1.0-alpha.4 or earlier
EntityView.data(EntityDataKey)StoredDataThe entity's data for key; call markChanged() after changing it.0.1.0-alpha.4 or earlier
EntityView.hasNoGravity()booleanWhether gravity is off for this entity.0.1.0-alpha.4 or earlier
EntityView.isAlive()booleanWhether the entity is alive and in a world.0.1.0-alpha.4 or earlier
EntityView.isIn(TagKey)booleanWhether the entity's type is in an entity type tag, for example #minecraft:skeletons.0.1.0-alpha.4 or earlier
EntityView.isOnGround()booleanWhether the entity stands on a block.0.1.0-alpha.4 or earlier
EntityView.name()StringDisplay name as plain text.0.1.0-alpha.4 or earlier
EntityView.passengers()List<EntityView>Who rides the entity.0.1.0-alpha.4 or earlier
EntityView.pitch()floatVertical facing in degrees (-90 up, 90 down).0.1.0-alpha.4 or earlier
EntityView.remove()voidRemoves the entity without dropping loot; server side only.0.1.0-alpha.4 or earlier
EntityView.setNoGravity(boolean)voidTurns gravity off or on.0.1.0-alpha.4 or earlier
EntityView.setRotation(float, float)voidTurns the entity.0.1.0-alpha.4 or earlier
EntityView.setVelocity(double, double, double)voidSets the velocity; for players it reaches their client.0.1.0-alpha.4 or earlier
EntityView.startRiding(EntityView)booleanMounts vehicle.0.1.0-alpha.4 or earlier
EntityView.stopRiding()voidDismounts, if riding.0.1.0-alpha.4 or earlier
EntityView.teleport(double, double, double)voidMoves the entity within its dimension; server side only.0.1.0-alpha.4 or earlier
EntityView.type()ResourceIdEntity type, for example minecraft:pig.0.1.0-alpha.4 or earlier
EntityView.uuid()UUIDUnique, persistent entity ID.0.1.0-alpha.4 or earlier
EntityView.vehicle()Optional<EntityView>What the entity rides, if anything.0.1.0-alpha.4 or earlier
EntityView.velocity()Vector3Velocity in blocks per tick.0.1.0-alpha.4 or earlier
EntityView.world()WorldViewThe world the entity is in.0.1.0-alpha.4 or earlier
EntityView.x()doubleX coordinate.0.1.0-alpha.4 or earlier
EntityView.y()doubleY coordinate (feet).0.1.0-alpha.4 or earlier
EntityView.yaw()floatHorizontal facing in degrees (0 south, 90 west, 180 north, 270 east).0.1.0-alpha.4 or earlier
EntityView.z()doubleZ coordinate.0.1.0-alpha.4 or earlier
LivingEntityView.addEffect(ResourceId, int, int)voidAdds a status effect, such as minecraft:speed or a mod effect.0.1.0-alpha.4 or earlier
LivingEntityView.hasEffect(ResourceId)booleanWhether the entity has the effect.0.1.0-alpha.4 or earlier
LivingEntityView.health()floatCurrent health in half-hearts.0.1.0-alpha.4 or earlier
LivingEntityView.hurt(ResourceId, float)booleanDeals damage of a data-defined damage type, such as minecraft:magic or one from the mod's data/<mod id>/damage_type/.0.1.0-alpha.4 or earlier
LivingEntityView.hurt(float)booleanDeals generic damage on the server, as if from /damage.0.1.0-alpha.4 or earlier
LivingEntityView.launchProjectile(ResourceId, float, float)EntityViewLaunches a projectile, such as a mod projectile or minecraft:snowball, from the eyes in the look direction.0.1.0-alpha.4 or earlier
LivingEntityView.maxHealth()floatMaximum health.0.1.0-alpha.4 or earlier
LivingEntityView.setHealth(float)voidSets health, clamped to [0, maxHealth]; server side only.0.1.0-alpha.4 or earlier
MobView.isNavigating()booleanWhether the mob is following a path.0.1.0-alpha.4 or earlier
MobView.lookAt(double, double, double)voidTurns the head towards a position this tick.0.1.0-alpha.4 or earlier
MobView.navigateTo(double, double, double, double)booleanStarts walking to a position along a path.0.1.0-alpha.4 or earlier
MobView.playAnimation(String)voidPlays one of the mob's ON_DEMAND model animations from the start on every client that sees the mob.0.1.0-alpha.4 or earlier
MobView.setTarget(LivingEntityView)voidSets the attack target, or clears it with null.0.1.0-alpha.4 or earlier
MobView.stopAnimation(String)voidStops an ON_DEMAND animation on every client; a non-looping one also stops by itself at its end.0.1.0-alpha.4 or earlier
MobView.stopNavigating()voidStops following the path.0.1.0-alpha.4 or earlier
MobView.target()Optional<LivingEntityView>The attack target, if any.0.1.0-alpha.4 or earlier
PlayerView.countItem(ResourceId)intHow many of item the player carries in their inventory.0.1.0-alpha.4 or earlier
PlayerView.give(ResourceId, int)voidGives the player count of item; what does not fit is dropped at their feet.0.1.0-alpha.4 or earlier
PlayerView.grantAdvancement(ResourceId)booleanCompletes every criterion of an advancement, with its rewards and announcement.0.1.0-alpha.4 or earlier
PlayerView.hasAdvancement(ResourceId)booleanWhether the player has completed an advancement, such as minecraft:story/mine_stone.0.1.0-alpha.4 or earlier
PlayerView.hasPermission(PermissionNode)booleanWhether the player has the permission: the first deciding provider, else the node's default operator level.0.1.0-alpha.4 or earlier
PlayerView.inventory()InventoryViewThe player's inventory: 36 main slots (hotbar 0–8), then armour and off hand.0.1.0-alpha.4 or earlier
PlayerView.mainHandItem()ResourceIdThe item in the main hand, minecraft:air when empty.0.1.0-alpha.4 or earlier
PlayerView.mainHandStack()ItemStackRefThe live stack in the main hand.0.1.0-alpha.4 or earlier
PlayerView.openMenu(BlockPos)booleanOpens the menu of the block entity at pos (a chest-style or laid-out mod menu, or a game container such as a furnace) for this player.0.1.0-alpha.4 or earlier
PlayerView.revokeAdvancement(ResourceId)booleanClears every criterion of an advancement.0.1.0-alpha.4 or earlier
PlayerView.sendMessage(String)voidShows text in the player's chat.0.1.0-alpha.4 or earlier

event​

FunctionReturnsDescriptionSince
EventKey.id()StringDiagnostic ID, e.g.0.1.0-alpha.4 or earlier
EventKey.listenerType()Class<L>The listener interface.0.1.0-alpha.4 or earlier
EventKey.of(String, Class<L>)EventKey<L>Creates a key; id is namespace:path and only used for diagnostics.0.1.0-alpha.4 or earlier
EventRegistry.register(EventKey<L>, EventPriority, L)voidRegisters listener for event.0.1.0-alpha.4 or earlier
EventRegistry.register(EventKey<L>, L)voidRegisters listener for event with EventPriority.NORMAL.0.1.0-alpha.4 or earlier
EventResult.isDecided()booleanWhether this result decides the event, i.e. is not PASS.0.1.0-alpha.4 or earlier

event.block​

FunctionReturnsDescriptionSince
BlockBreakListener.onBlockBreak(WorldView, BlockPos, ResourceId, PlayerView)EventResultCalled on the server thread before the block is removed.0.1.0-alpha.4 or earlier
BlockBrokenListener.onBlockBroken(WorldView, BlockPos, ResourceId, PlayerView)voidCalled on the server thread after the block was removed and its drops spawned.0.1.0-alpha.4 or earlier
BlockPlaceListener.onBlockPlace(WorldView, BlockPos, ResourceId, PlayerView)EventResultCalled on the server thread after the game checked that the block fits, before it is set.0.1.0-alpha.4 or earlier
BlockPlacedListener.onBlockPlaced(WorldView, BlockPos, ResourceId, PlayerView)voidCalled on the server thread after the block was placed, its block entity data applied, and the item used up.0.1.0-alpha.4 or earlier

event.entity​

FunctionReturnsDescriptionSince
AllowDamageListener.allowDamage(LivingEntityView, DamageInfo)booleanReturns false to cancel the damage.0.1.0-alpha.4 or earlier
DamageModifier.modifyDamage(LivingEntityView, DamageInfo)floatReturns the damage to deal instead of damage.amount(); return it unchanged to keep it.0.1.0-alpha.4 or earlier
DeathListener.onDied(LivingEntityView, DamageInfo)voidCalled on the server thread when death starts, before drops.0.1.0-alpha.4 or earlier
EntityJoinedWorldListener.onEntityJoinedWorld(EntityView, WorldView)voidCalled on the server thread while the world starts tracking the entity.0.1.0-alpha.4 or earlier

event.interaction​

FunctionReturnsDescriptionSince
AttackEntityListener.onAttackEntity(PlayerView, EntityView)EventResultCalled on the server thread.0.1.0-alpha.4 or earlier
UseBlockListener.onUseBlock(PlayerView, Hand, ItemStackRef, BlockPos, Direction)InteractionResultCalled on the server thread.0.1.0-alpha.4 or earlier
UseEntityListener.onUseEntity(PlayerView, Hand, ItemStackRef, EntityView)InteractionResultCalled on the server thread.0.1.0-alpha.4 or earlier
UseItemListener.onUseItem(PlayerView, Hand, ItemStackRef)InteractionResultCalled on the server thread, also for an empty hand.0.1.0-alpha.4 or earlier

event.lifecycle​

FunctionReturnsDescriptionSince
ModsInitializedListener.onModsInitialized()voidHandles the event.0.1.0-alpha.10

event.player​

FunctionReturnsDescriptionSince
LoginCheckListener.checkLogin(UUID, String)Optional<String>Returns a reason to refuse the player, shown on their disconnect screen, or empty to let them in.0.1.0-alpha.4 or earlier
PlayerCopyListener.onPlayerCopy(PlayerView, PlayerView, boolean)voidCalled on the server thread while the game builds the new player object for a respawn, after the game copied what it keeps (inventory with keepInventory, everything when returning from the End) and after Poly Mod Loader copied EntityDataKey data.0.1.0-alpha.4 or earlier
PlayerJoinedListener.onPlayerJoined(PlayerView)voidCalled on the server thread; player is valid only during the call.0.1.0-alpha.4 or earlier
PlayerLeavingListener.onPlayerLeaving(PlayerView)voidCalled on the server thread before the player is removed; player is valid only during the call.0.1.0-alpha.4 or earlier
PlayerRespawnedListener.onPlayerRespawned(PlayerView, boolean)voidCalled on the server thread after the new player object was placed in its world.0.1.0-alpha.4 or earlier

event.server​

FunctionReturnsDescriptionSince
ServerStartedListener.onServerStarted(ServerView)voidHandles the event.0.1.0-alpha.4 or earlier
ServerStartingListener.onServerStarting(ServerView)voidHandles the event.0.1.0-alpha.4 or earlier
ServerStoppedListener.onServerStopped(ServerView)voidHandles the event.0.1.0-alpha.4 or earlier
ServerStoppingListener.onServerStopping(ServerView)voidHandles the event.0.1.0-alpha.4 or earlier
ServerTickListener.onServerTick(ServerView)voidHandles the event.0.1.0-alpha.4 or earlier
ServerView.dedicated()booleanWhether Minecraft reports this server as dedicated.0.1.0-alpha.4 or earlier
ServerView.motd()StringMessage of the day shown in the server list.0.1.0-alpha.4 or earlier
ServerView.playerCount()intPlayers currently connected.0.1.0-alpha.4 or earlier
ServerView.tickCount()intTicks processed so far.0.1.0-alpha.4 or earlier

event.world​

FunctionReturnsDescriptionSince
ChunkListener.onChunk(WorldView, int, int)voidA chunk of world; coordinates are chunk coordinates.0.1.0-alpha.4 or earlier
WorldListener.onWorld(WorldView)voidCalled on the server thread; world is valid only during the call.0.1.0-alpha.4 or earlier
WorldReadyListener.onWorldReady(WorldView)voidCalled on the server thread at the start of the dimension's first tick.0.1.0-alpha.4 or earlier

inventory​

FunctionReturnsDescriptionSince
InventoryView.add(ResourceId, int)intAdds items to existing stacks first, then to empty slots.0.1.0-alpha.4 or earlier
InventoryView.clear()voidEmpties every slot.0.1.0-alpha.4 or earlier
InventoryView.count(ResourceId)intHow many of item the inventory holds.0.1.0-alpha.4 or earlier
InventoryView.get(int)ItemStackViewThe stack in slot; IndexOutOfBoundsException for a bad slot.0.1.0-alpha.4 or earlier
InventoryView.set(int, ResourceId, int)voidReplaces the stack in slot; a count of 0 empties it.0.1.0-alpha.4 or earlier
InventoryView.size()intNumber of slots.0.1.0-alpha.4 or earlier
InventoryView.stackAt(int)ItemStackRefThe live stack in slot, to read or change its components.0.1.0-alpha.4 or earlier
ItemStackRef.count()intHow many, 0 when empty.0.1.0-alpha.4 or earlier
ItemStackRef.customName()Optional<String>The name given with an anvil or setCustomName, if any.0.1.0-alpha.4 or earlier
ItemStackRef.damage()intDurability used up, 0 for undamaged or undamageable items.0.1.0-alpha.4 or earlier
ItemStackRef.get(ItemComponentKey<T>)Optional<T>The component's value, or empty when the stack does not have it.0.1.0-alpha.4 or earlier
ItemStackRef.isEmpty()booleanWhether the stack is empty.0.1.0-alpha.4 or earlier
ItemStackRef.isIn(TagKey)booleanWhether the stack's item is in an item tag, for example #minecraft:logs; false for an empty stack.0.1.0-alpha.4 or earlier
ItemStackRef.item()ResourceIdThe item, minecraft:air when empty.0.1.0-alpha.4 or earlier
ItemStackRef.maxDamage()intDurability, 0 for undamageable items.0.1.0-alpha.4 or earlier
ItemStackRef.remove(ItemComponentKey<?>)voidRemoves the component.0.1.0-alpha.4 or earlier
ItemStackRef.set(ItemComponentKey<T>, T)voidSets the component's value.0.1.0-alpha.4 or earlier
ItemStackRef.setCount(int)voidChanges the count; 0 empties the stack.0.1.0-alpha.4 or earlier
ItemStackRef.setCustomName(String)voidGives the stack a name, or removes it with null.0.1.0-alpha.4 or earlier
ItemStackRef.setDamage(int)voidSets the used durability, clamped to [0, maxDamage].0.1.0-alpha.4 or earlier
ItemStackRef.snapshot()ItemStackViewA snapshot of item and count.0.1.0-alpha.4 or earlier
ItemStackView.isEmpty()booleanWhether the slot is empty.0.1.0-alpha.4 or earlier

lifecycle​

FunctionReturnsDescriptionSince
ClientModInitializer.onInitializeClient(ModContext)voidInitialises the mod's client-only parts.0.1.0-alpha.4 or earlier
CommonModInitializer.onInitializeCommon(ModContext)voidInitialises the mod's common (side-independent) parts.0.1.0-alpha.4 or earlier
DedicatedServerModInitializer.onInitializeDedicatedServer(ModContext)voidInitialises the mod's dedicated-server-only parts.0.1.0-alpha.4 or earlier
LoadedMods.all()List<LoadedMods.Mod>Every loaded mod: first those a host loader runs, then the others in the order their entrypoints run.0.1.0-alpha.18
LoadedMods.find(String)Optional<LoadedMods.Mod>The loaded mod with modId: the mod whose own ID it is, otherwise the first mod that provides it; empty when none is loaded.0.1.0-alpha.18
LoadedMods.isLoaded(String)booleanWhether a mod with modId is loaded, by its own ID or an ID it provides (provides in fabric.mod.json).0.1.0-alpha.18
ModContext.client()ClientRegistrarClient-only registrations: key bindings and HUD layers.0.1.0-alpha.4 or earlier
ModContext.commands()CommandRegistrarRegisters this mod's server commands.0.1.0-alpha.4 or earlier
ModContext.configDirectory()PathThis mod's configuration directory, config/<mod id> in the game directory; created on first call.0.1.0-alpha.4 or earlier
ModContext.content()ContentRegistrarDeclares this mod's blocks and items (common entrypoints only).0.1.0-alpha.4 or earlier
ModContext.events()EventRegistryRegisters event listeners owned by this mod.0.1.0-alpha.4 or earlier
ModContext.gameTests()GameTestRegistrarRegisters this mod's in-game tests.0.1.0-alpha.4 or earlier
ModContext.modId()StringThe mod ID declared in poly.mod.json, for example minimal_native_mod.0.1.0-alpha.4 or earlier
ModContext.modVersion()StringThe mod version declared in poly.mod.json.0.1.0-alpha.4 or earlier
ModContext.mods()LoadedModsThe mods loaded in this game, of every loader (Poly Mods, Fabric mods, Forge mods).0.1.0-alpha.18
ModContext.network()NetworkRegistrarDeclares this mod's network channels.0.1.0-alpha.4 or earlier
ModContext.onShutdown(String, Runnable)voidRegisters work to run when the game process exits.0.1.0-alpha.4 or earlier
ModContext.permissions()PermissionRegistrarThe mod's permissions and permission providers.0.1.0-alpha.4 or earlier
ModContext.resources()ResourceRegistrarReload listeners for the mod's own data and asset files.0.1.0-alpha.4 or earlier
ModContext.side()GameSideWhether this process is a client or a dedicated server.0.1.0-alpha.4 or earlier
ModContext.systems()SystemLookupThe active implementation of each Poly Mod Loader system, after replacements were applied.0.1.0-alpha.4 or earlier
ModContext.worldgen()WorldgenRegistrarAttaches this mod's placed features to biomes.0.1.0-alpha.4 or earlier

network​

FunctionReturnsDescriptionSince
ClientPayloadHandler.receive(T)voidCalled on the client thread.0.1.0-alpha.4 or earlier
ConfigurationExchange.Answer.answer(T)TThe reply to the server's request.0.1.0-alpha.4 or earlier
ConfigurationExchange.Check.check(UUID, String, Optional<T>)Optional<String>Empty to let the player in, or the message shown to them when the connection is refused.0.1.0-alpha.4 or earlier
ConfigurationExchange.Request.request(UUID, String)Optional<T>The message for player playerName, or empty to skip the exchange for them.0.1.0-alpha.4 or earlier
ConfigurationExchange.clientAnswer(ConfigurationExchange.Answer<T>)ConfigurationExchange<T>How the client answers; without it the client does not answer.0.1.0-alpha.4 or earlier
ConfigurationExchange.id()ResourceIdThe exchange's ID, <mod id>:<path>.0.1.0-alpha.4 or earlier
ConfigurationExchange.serverCheck(ConfigurationExchange.Check<T>)ConfigurationExchange<T>Whether the server lets the player in after the client's answer.0.1.0-alpha.4 or earlier
ConfigurationExchange.serverRequest(ConfigurationExchange.Request<T>)ConfigurationExchange<T>What the server sends to each joining player; without it the exchange is skipped.0.1.0-alpha.4 or earlier
ConfigurationExchange.timeoutTicks(int)ConfigurationExchange<T>How long the server waits for the answer, in ticks; 100 (5 seconds) by default.0.1.0-alpha.4 or earlier
NetworkRegistrar.channel(String, PayloadCodec<T>)PayloadChannel<T>Declares a channel.0.1.0-alpha.4 or earlier
NetworkRegistrar.configurationExchange(String, PayloadCodec<T>)ConfigurationExchange<T>Declares configuration exchange <mod id>:<path>: a question the server asks each joining client before the player enters the world.0.1.0-alpha.4 or earlier
PayloadChannel.id()ResourceIdThe channel ID.0.1.0-alpha.4 or earlier
PayloadChannel.onClientReceive(ClientPayloadHandler<T>)voidSets what the client does with payloads from the server.0.1.0-alpha.4 or earlier
PayloadChannel.onServerReceive(ServerPayloadHandler<T>)voidSets what the server does with payloads from clients.0.1.0-alpha.4 or earlier
PayloadChannel.sendToPlayer(PlayerView, T)voidSends a payload to one player.0.1.0-alpha.4 or earlier
PayloadChannel.sendToServer(T)voidSends a payload to the server.0.1.0-alpha.4 or earlier
PayloadCodec.decode(PayloadReader)TReads a value written by encode.0.1.0-alpha.4 or earlier
PayloadCodec.encode(T, PayloadWriter)voidWrites value.0.1.0-alpha.4 or earlier
PayloadCodec.string()PayloadCodec<String>A codec for a single UTF-8 string.0.1.0-alpha.4 or earlier
PayloadReader.readBoolean()booleanReads a boolean.0.1.0-alpha.4 or earlier
PayloadReader.readBytes()byte[]Reads a byte array.0.1.0-alpha.4 or earlier
PayloadReader.readDouble()doubleReads a double.0.1.0-alpha.4 or earlier
PayloadReader.readInt()intReads an int.0.1.0-alpha.4 or earlier
PayloadReader.readLong()longReads a long.0.1.0-alpha.4 or earlier
PayloadReader.readString()StringReads a string.0.1.0-alpha.4 or earlier
PayloadReader.remaining()intBytes not read yet.0.1.0-alpha.4 or earlier
PayloadWriter.writeBoolean(boolean)PayloadWriterWrites a boolean as one byte.0.1.0-alpha.4 or earlier
PayloadWriter.writeBytes(byte[])PayloadWriterWrites a length-prefixed byte array.0.1.0-alpha.4 or earlier
PayloadWriter.writeDouble(double)PayloadWriterWrites an 8-byte double.0.1.0-alpha.4 or earlier
PayloadWriter.writeInt(int)PayloadWriterWrites a 4-byte int.0.1.0-alpha.4 or earlier
PayloadWriter.writeLong(long)PayloadWriterWrites an 8-byte long.0.1.0-alpha.4 or earlier
PayloadWriter.writeString(String)PayloadWriterWrites a length-prefixed UTF-8 string (at most 32767 characters).0.1.0-alpha.4 or earlier
ServerPayloadHandler.receive(T, PlayerView)voidCalled on the server thread.0.1.0-alpha.4 or earlier

permission​

FunctionReturnsDescriptionSince
PermissionProvider.check(PlayerView, PermissionNode)PermissionResultWhether player has node, or PermissionResult.UNDECIDED to let the next provider or the node's default decide.0.1.0-alpha.4 or earlier
PermissionRegistrar.node(String, int)PermissionNodeDeclares <mod id>.<path>.0.1.0-alpha.4 or earlier
PermissionRegistrar.provider(PermissionProvider)voidAdds a provider asked for every permission check of every mod.0.1.0-alpha.4 or earlier

resource​

FunctionReturnsDescriptionSince
BinaryReloadListener.onReload(Map<ResourceId,byte[]>)voidFiles by ID (<namespace>:<path without the suffix>); the arrays are the listener's own.0.1.0-alpha.4 or earlier
ResourceId.minecraft(String)ResourceIdAn identifier in the minecraft namespace.0.1.0-alpha.4 or earlier
ResourceId.of(String, String)ResourceIdCreates namespace:path.0.1.0-alpha.4 or earlier
ResourceId.parse(String)ResourceIdParses namespace:path; text without a colon is in the minecraft namespace, as in the game's commands and data files.0.1.0-alpha.4 or earlier
ResourceRegistrar.onAssetFiles(String, String, BinaryReloadListener)voidLike onAssetReload, for files ending in suffix, as bytes.0.1.0-alpha.4 or earlier
ResourceRegistrar.onAssetReload(String, ResourceReloadListener)voidReads assets/<namespace>/<directory>/**.json from the enabled resource packs when the client starts and on F3+T; the listener runs on the client thread.0.1.0-alpha.4 or earlier
ResourceRegistrar.onDataFiles(String, String, BinaryReloadListener)voidLike onDataReload, for files ending in suffix (for example .png or .txt), handed over as bytes.0.1.0-alpha.4 or earlier
ResourceRegistrar.onDataReload(String, ResourceReloadListener)voidReads data/<namespace>/<directory>/**.json from all enabled data packs (including mod jars) when the server starts and on /reload; the listener runs on the server thread after the game's own data has loaded.0.1.0-alpha.4 or earlier
ResourceReloadListener.onReload(Map<ResourceId,String>)voidThe JSON files found, by ID: data/<namespace>/<directory>/<path>.json becomes <namespace>:<path>; contents are UTF-8 text.0.1.0-alpha.4 or earlier

stability​

FunctionReturnsDescriptionSince
ApiStability.value()StabilityLevelThe stability level of the annotated element.0.1.0-alpha.4 or earlier

system​

FunctionReturnsDescriptionSince
SystemId.parse(String)Optional<SystemId>Parses value, or returns empty when it is not a valid system ID.0.1.0-alpha.4 or earlier
SystemLookup.get(Class<T>)TReturns the active implementation of contract.0.1.0-alpha.4 or earlier
SystemProvider.create(SystemContext)TCreates the system implementation.0.1.0-alpha.4 or earlier

system.brand​

FunctionReturnsDescriptionSince
GameBrandSystem.brand(GameSide)StringThe brand reported by side.0.1.0-alpha.4 or earlier

tag​

FunctionReturnsDescriptionSince
TagKey.block(ResourceId)TagKeyA block tag, for example TagKey.block(ResourceId.minecraft("mineable/pickaxe")).0.1.0-alpha.4 or earlier
TagKey.entityType(ResourceId)TagKeyAn entity type tag, for example TagKey.entityType(ResourceId.minecraft("skeletons")).0.1.0-alpha.4 or earlier
TagKey.item(ResourceId)TagKeyAn item tag, for example TagKey.item(ResourceId.minecraft("logs")).0.1.0-alpha.4 or earlier
TagKey.toString()StringThe tag as written in commands and data files, for example #minecraft:logs.0.1.0-alpha.4 or earlier
TagRegistry.directory()StringThe folder under tags/ that holds this registry's tag files, for example block.0.1.0-alpha.4 or earlier
TagView.contains(TagKey, ResourceId)booleanWhether entry (a block, item, or entity type ID, matching the tag's registry) is in the tag, including through nested tags.0.1.0-alpha.4 or earlier
TagView.entries(TagKey)List<ResourceId>Every entry of the tag, nested tags resolved, in the game's order; empty for an unknown tag.0.1.0-alpha.4 or earlier

world​

FunctionReturnsDescriptionSince
BlockPos.above()BlockPosThe position one block up.0.1.0-alpha.4 or earlier
BlockPos.below()BlockPosThe position one block down.0.1.0-alpha.4 or earlier
BlockPos.of(int, int, int)BlockPosCreates a position.0.1.0-alpha.4 or earlier
BlockPos.offset(int, int, int)BlockPosThis position moved by the given amounts.0.1.0-alpha.4 or earlier
Direction.isHorizontal()booleanWhether this is one of the four horizontal directions.0.1.0-alpha.4 or earlier
Direction.opposite()DirectionThe direction pointing the other way.0.1.0-alpha.4 or earlier
StorageOptions.syncedToClients()StorageOptionsThese options, synchronised to clients.0.1.0-alpha.4 or earlier
StorageOptions.withVersion(int, DataMigration)StorageOptionsThese options at version, upgrading older data with migration.0.1.0-alpha.4 or earlier
StoredData.data()DataTreeThe data; call markChanged() after changing it so it is saved.0.1.0-alpha.4 or earlier
StoredData.markChanged()voidMarks the data for saving with the next world save.0.1.0-alpha.4 or earlier
Vector3.length()doubleLength of the vector.0.1.0-alpha.4 or earlier
WorldView.biomeAt(BlockPos)ResourceIdThe biome at pos, for example minecraft:plains.0.1.0-alpha.4 or earlier
WorldView.blockAt(BlockPos)ResourceIdThe block at pos, for example minecraft:air.0.1.0-alpha.4 or earlier
WorldView.blockEntityAt(BlockPos)Optional<BlockEntityView>The mod block entity at pos, if there is one.0.1.0-alpha.4 or earlier
WorldView.dimension()ResourceIdThe dimension, for example minecraft:overworld.0.1.0-alpha.4 or earlier
WorldView.emittedLight(BlockPos)intLight the block at pos emits, 0–15.0.1.0-alpha.4 or earlier
WorldView.entitiesNear(double, double, double, double)List<EntityView>Entities whose position is within radius blocks of the point.0.1.0-alpha.4 or earlier
WorldView.gameRule(GameRuleKey<T>)TThe current value of a game rule in this world; server side only.0.1.0-alpha.4 or earlier
WorldView.gameTime()longTicks since the world was created.0.1.0-alpha.4 or earlier
WorldView.isBlockIn(BlockPos, TagKey)booleanWhether the block at pos is in a block tag, for example #minecraft:logs.0.1.0-alpha.4 or earlier
WorldView.isChunkLoaded(int, int)booleanWhether the chunk is loaded.0.1.0-alpha.4 or earlier
WorldView.isClientSide()booleanWhether this is the client's copy of the world, which must not be changed.0.1.0-alpha.4 or earlier
WorldView.naturalSpawns(BlockPos, MobCategory)List<ResourceId>Mobs that can spawn by themselves at pos in category, by the biome there; for checking natural spawn settings.0.1.0-alpha.4 or earlier
WorldView.otherDimension(ResourceId)Optional<WorldView>Another loaded dimension of the same server, such as a mod dimension from data; server side only.0.1.0-alpha.4 or earlier
WorldView.playSound(BlockPos, ResourceId, float, float)voidPlays a sound to players near pos (server) or locally (client).0.1.0-alpha.4 or earlier
WorldView.players()List<PlayerView>Players in this dimension.0.1.0-alpha.4 or earlier
WorldView.schedule(int, Runnable)voidRuns task on the server thread after ticks ticks of this dimension (0 = next tick).0.1.0-alpha.4 or earlier
WorldView.setBlock(BlockPos, ResourceId)booleanReplaces the block at pos with the default state of block and notifies neighbours and clients.0.1.0-alpha.4 or earlier
WorldView.setChunkForced(int, int, boolean)booleanKeeps a chunk loaded (and ticking) until released, like /forceload; saved with the world.0.1.0-alpha.4 or earlier
WorldView.setGameRule(GameRuleKey<T>, T)voidChanges a game rule for this world; server side only.0.1.0-alpha.4 or earlier
WorldView.setProperty(BlockPos, BlockProperty<T>, T)booleanChanges one property of the block at pos, keeping the others.0.1.0-alpha.4 or earlier
WorldView.spawnEntity(ResourceId, double, double, double)EntityViewSpawns an entity of type (for example minecraft:pig or a mod mob) at the position; server side only.0.1.0-alpha.4 or earlier
WorldView.spawnParticles(ResourceId, double, double, double, int, double)voidShows a simple particle (one without options, such as minecraft:heart or minecraft:flame) to nearby players; server side only.0.1.0-alpha.4 or earlier
WorldView.stateAt(BlockPos)BlockStateViewThe block and its property values at pos.0.1.0-alpha.4 or earlier
WorldView.storage(ResourceId)StoredDataData saved with this dimension under id (use your mod ID as namespace), created empty on first use.0.1.0-alpha.4 or earlier
WorldView.storage(ResourceId, StorageOptions)StoredDataWorld storage with a data version and optional client synchronisation.0.1.0-alpha.4 or earlier
WorldView.tags()TagViewThe block, item, and entity type tags the game loaded (the server's data, or the client's copy).0.1.0-alpha.4 or earlier

worldgen​

FunctionReturnsDescriptionSince
BiomeDefinition.Builder.build()BiomeDefinitionCreates the definition.0.1.0-alpha.4 or earlier
BiomeDefinition.Builder.climate(float, float, boolean)BiomeDefinition.BuilderTemperature (plains 0.8), downfall (plains 0.4) and whether it rains or snows.0.1.0-alpha.4 or earlier
BiomeDefinition.Builder.feature(GenerationStepName, ResourceId)BiomeDefinition.BuilderAdds a placed feature, such as minecraft:trees_plains, in step.0.1.0-alpha.4 or earlier
BiomeDefinition.Builder.fogColor(int)BiomeDefinition.BuilderFog colour, 0xRRGGBB.0.1.0-alpha.4 or earlier
BiomeDefinition.Builder.foliageColor(int)BiomeDefinition.BuilderLeaf colour, 0xRRGGBB, instead of one computed from the climate.0.1.0-alpha.4 or earlier
BiomeDefinition.Builder.grassColor(int)BiomeDefinition.BuilderGrass colour, 0xRRGGBB, instead of one computed from the climate.0.1.0-alpha.4 or earlier
BiomeDefinition.Builder.skyColor(int)BiomeDefinition.BuilderSky colour, 0xRRGGBB.0.1.0-alpha.4 or earlier
BiomeDefinition.Builder.spawn(MobCategory, ResourceId, int, int, int)BiomeDefinition.BuilderAdds a naturally spawning mob.0.1.0-alpha.4 or earlier
BiomeDefinition.Builder.waterColor(int)BiomeDefinition.BuilderWater colour, 0xRRGGBB.0.1.0-alpha.4 or earlier
BiomeDefinition.builder()BiomeDefinition.BuilderA builder with plains-like values and no features or spawns.0.1.0-alpha.4 or earlier
BiomeSelector.ids(ResourceId[])BiomeSelectorBiomes with one of these IDs.0.1.0-alpha.4 or earlier
BiomeSelector.tag(ResourceId)BiomeSelectorBiomes in this tag.0.1.0-alpha.4 or earlier
CodeFeature.place(FeatureContext)booleanPlaces the feature around FeatureContext.origin().0.1.0-alpha.4 or earlier
ColumnBuilder.fill(int, int, ResourceId)voidSets block from fromY to toY, both inclusive.0.1.0-alpha.4 or earlier
ColumnBuilder.maxY()intHighest Y of the dimension (inclusive).0.1.0-alpha.4 or earlier
ColumnBuilder.minY()intLowest Y of the dimension.0.1.0-alpha.4 or earlier
ColumnBuilder.seed()longA number derived from the world seed and the generator ID, the same for every column.0.1.0-alpha.4 or earlier
ColumnBuilder.set(int, ResourceId)voidSets the default state of block at y; positions outside the dimension are ignored.0.1.0-alpha.4 or earlier
FeatureContext.blockAt(BlockPos)ResourceIdThe block at pos, without properties.0.1.0-alpha.4 or earlier
FeatureContext.isAir(BlockPos)booleanWhether pos is air.0.1.0-alpha.4 or earlier
FeatureContext.maxY()intThe highest block y of the world.0.1.0-alpha.4 or earlier
FeatureContext.minY()intThe lowest block y of the world.0.1.0-alpha.4 or earlier
FeatureContext.origin()BlockPosThe position the placement chose, for example on the surface or at a random height.0.1.0-alpha.4 or earlier
FeatureContext.random()RandomGeneratorRandomness for this placement; the same world seed and position give the same values.0.1.0-alpha.4 or earlier
FeatureContext.setBlock(BlockPos, ResourceId)voidSets the default state of block at pos.0.1.0-alpha.4 or earlier
FeatureContext.surfaceY(int, int)intThe y of the first air block above the terrain at x, z, as generation sees it so far.0.1.0-alpha.4 or earlier
FeaturePlacement.atHeight(int, int, int)FeaturePlacementcountPerChunk tries at random heights from minY to maxY in each chunk.0.1.0-alpha.4 or earlier
FeaturePlacement.onSurface(int)FeaturePlacementcountPerChunk tries on the surface of each chunk.0.1.0-alpha.4 or earlier
FeaturePlacement.rarity(int)FeaturePlacementThis placement in only 1 of rarity chunks.0.1.0-alpha.4 or earlier
NoiseFunction.compute(int, int, int)doubleThe density at block x, y, z.0.1.0-alpha.4 or earlier
StructureBuilder.build(StructurePieceContext)voidWrites the structure's blocks through context.0.1.0-alpha.4 or earlier
StructureDefinition.Builder.adaptTerrain()StructureDefinition.BuilderSmooths the terrain around the box, like around a village.0.1.0-alpha.4 or earlier
StructureDefinition.Builder.biomes(BiomeSelector)StructureDefinition.BuilderWhere it may generate; every overworld biome (#minecraft:is_overworld) by default.0.1.0-alpha.4 or earlier
StructureDefinition.Builder.build()StructureDefinitionCreates the definition; invalid values throw IllegalArgumentException.0.1.0-alpha.4 or earlier
StructureDefinition.Builder.spacing(int, int)StructureDefinition.BuilderAverage and minimum distance between structures in chunks; 32 and 8 by default.0.1.0-alpha.4 or earlier
StructureDefinition.Builder.step(GenerationStepName)StructureDefinition.BuilderThe generation step; GenerationStepName.SURFACE_STRUCTURES by default.0.1.0-alpha.4 or earlier
StructureDefinition.Builder.yOffset(int)StructureDefinition.BuilderRaises (or with a negative value sinks) the box relative to the surface; 0 by default.0.1.0-alpha.4 or earlier
StructureDefinition.builder(int, int, int, StructureBuilder)StructureDefinition.BuilderA builder for a sizeX × sizeY × sizeZ structure built by builder.0.1.0-alpha.4 or earlier
StructurePieceContext.blockAt(int, int, int)ResourceIdThe block at a box position, without properties.0.1.0-alpha.4 or earlier
StructurePieceContext.fill(int, int, int, int, int, int, ResourceId)voidFills the box positions from (x1, y1, z1) to (x2, y2, z2), both included.0.1.0-alpha.4 or earlier
StructurePieceContext.origin()BlockPosWorld position of the box's lowest corner.0.1.0-alpha.4 or earlier
StructurePieceContext.random()RandomGeneratorRandomness for this structure; the same on every call for the same structure.0.1.0-alpha.4 or earlier
StructurePieceContext.setBlock(int, int, int, ResourceId)voidSets the default state of block at a box position.0.1.0-alpha.4 or earlier
StructurePieceContext.sizeX()intBox size along x.0.1.0-alpha.4 or earlier
StructurePieceContext.sizeY()intBox size along y.0.1.0-alpha.4 or earlier
StructurePieceContext.sizeZ()intBox size along z.0.1.0-alpha.4 or earlier
TerrainGenerator.fillColumn(int, int, ColumnBuilder)voidFills the column at world position x, z; unset blocks stay air.0.1.0-alpha.4 or earlier
TerrainGenerator.seaLevel()intSea level of dimensions using this generator; the game spawns water mobs and fish below it.0.1.0-alpha.4 or earlier
WorldgenRegistrar.addFeature(BiomeSelector, GenerationStepName, ResourceId)voidAdds a placed feature at the end of step in every selected biome.0.1.0-alpha.4 or earlier
WorldgenRegistrar.biome(String, BiomeDefinition)ResourceIdDefines biome <mod id>:<path> in code.0.1.0-alpha.4 or earlier
WorldgenRegistrar.chunkGenerator(String, TerrainGenerator)ResourceIdRegisters terrain written in code as generator type <mod id>:<path>, for dimensions in data packs.0.1.0-alpha.4 or earlier
WorldgenRegistrar.densityFunction(String, double, double, NoiseFunction)ResourceIdRegisters a density function written in code as type <mod id>:<path>.0.1.0-alpha.4 or earlier
WorldgenRegistrar.feature(String, FeaturePlacement, CodeFeature)ResourceIdRegisters a feature written in code as feature type <mod id>:<path>, and writes a configured and a placed feature with the same ID into Poly Mod Loader's generated data pack.0.1.0-alpha.4 or earlier
WorldgenRegistrar.structure(String, StructureDefinition)ResourceIdRegisters a structure built in code as <mod id>:<path>, with its structure set, in Poly Mod Loader's generated data pack.0.1.0-alpha.4 or earlier
Buy me a coffee